Signed and Permanent Cookies in Rails 3
m.onkey.org
Signed and Permanent Cookies in Rails 3
1–10 of 12 posts
Re: Signed and Permanent Cookies in Rails 3
#2To put the question a little shorter, isn't the concept of "20 years from now" independent of time zone, or am I missing something?
Re: Signed and Permanent Cookies in Rails 3
#3Re: Signed and Permanent Cookies in Rails 3
#4Looks like a cool feature, but I haven't yet gotten into Ruby or Rails. I do have one question, though. There is an interesting looking language feature I see: 20.years.from_now.utc . I would presume that to mean "20 years from this time in zulu". So presuming that 20.years.from_now.cdt means central daylight time, is that a different time? To put the question a little shorter, isn't the concept of "20 years from now…
Sat Feb 09 23:07:46 UTC 2030
Re: Signed and Permanent Cookies in Rails 3
#5Looks like a cool feature, but I haven't yet gotten into Ruby or Rails. I do have one question, though. There is an interesting looking language feature I see: 20.years.from_now.utc . I would presume that to mean "20 years from this time in zulu". So presuming that 20.years.from_now.cdt means central daylight time, is that a different time? To put the question a little shorter, isn't the concept of "20 years from now…
irb(main):033:0> 20.years
=> 20 years # ??????
irb(main):030:0> 20.years.to_i
=> 631152000 # number of seconds in 20 years
irb(main):026:0> 20.years.from_now
=> Sun Feb 10 10:14:11 +1100 2030 # AEDT
irb(main):027:0> 20.years.from_now.utc
=> Sat Feb 09 23:14:14 UTC 2030 # UTC/GMT
Ruby Time instances have a timezone, calling Time#utc returns the instance time converted from localtime -- or whatever timezone it is -- to UTC or Greenwich Mean Time. You are correct in that it shouldn't matter which one you use in this situation though.Re: Signed and Permanent Cookies in Rails 3
#6"A whole lot easier" Is this a joke?
Re: Signed and Permanent Cookies in Rails 3
#7Re: Signed and Permanent Cookies in Rails 3
#8Earlier quoted context omitted.
I don't understand your objection.
1. Rails already makes things very easy. 2. The improvement was for something that (yes, subjectively) did not look overly burdensome to begin with.
The more of this functionality Rails takes over and stops leaving up to developers, the happier I'll be.
Re: Signed and Permanent Cookies in Rails 3
#9Looks like a cool feature, but I haven't yet gotten into Ruby or Rails. I do have one question, though. There is an interesting looking language feature I see: 20.years.from_now.utc . I would presume that to mean "20 years from this time in zulu". So presuming that 20.years.from_now.cdt means central daylight time, is that a different time? To put the question a little shorter, isn't the concept of "20 years from now…
irb(main):033:0> 20.years => 20 years # ?????? irb(main):030:0> 20.years.to_i => 631152000 # number of seconds in 20 years irb(main):026:0> 20.years.from_now => Sun Feb 10 10:14:11 +1100 2030 # AEDT irb(main):027:0> 20.years.from_now.utc => Sat Feb 09 23:14:14 UTC 2030 # UTC/GMT Ruby Time instances have a timezone, calling Time#utc returns the instance time converted from localtime -- or whatever timezone it is -- to…
http://api.rubyonrails.org/classes/ActiveSupport/Duration.ht...