Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

'can't modify frozen object' when creating a new TimeZone #1966

Closed
jfelchner opened this Issue · 8 comments

3 participants

@jfelchner

::ActiveSupport::TimeZone.new('Mountain Time (US & Canada)').to_s

Throws a RuntimeError. The only one I've found that it does this with is 'Mountain Time (US & Canada)'

I'm on Ruby 1.9.2p180, Rails 3.0.7 and tzinfo 0.3.27

@jfelchner jfelchner closed this
@fxn
Owner
fxn commented

Just curious, what was finally the problem?

@jfelchner

I'm actually not sure but I was doing a bunch of metaprogramming and working with FactoryGirl. It could have been any 1 of a number of things and since I couldn't definitively track it down to Rails, I decided to close this.

@jfelchner jfelchner reopened this
@jfelchner

Ok I did finally track this down and it is a Rails issue.

ActiveSupport::TimeZone.new('Alaska').freeze throws RuntimeError: can't modify frozen object. I'm still tracking down why but it's definitely a Rails bug.

@jfelchner

Figured it out. I'll be submitting a patch in a few minutes.

@jfelchner

@fxn So I figured out what the problem is. And I've submitted a patch here:

#1977

As I said in the PR, although this definitely fixes the problem, I can't actually get the tests to fail so if you take a look and see why, I'd be much obliged if you could point me in the right direction. :)

@fxn
Owner
fxn commented

Thanks, I'll have a look later.

@franckverrot franckverrot referenced this issue from a commit in franckverrot/rails
@cghawthorne cghawthorne Destroy respects optimistic locking.
Now works with :dependent => :destroy and includes unit tests for that
case.  Also includes better error messages when updating/deleting stale
objects.

[#1966 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
ce5af2f
@lsylvester lsylvester referenced this issue from a commit in lsylvester/rails
@cghawthorne cghawthorne Destroy respects optimistic locking.
Now works with :dependent => :destroy and includes unit tests for that
case.  Also includes better error messages when updating/deleting stale
objects.

[#1966 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
7e06494
@drewblas

Since there is a separate issue 1977 with the PR can this issue be closed?

@jfelchner

Don't see why not. The references are all set up if we need to look back at this one.

@jfelchner jfelchner closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.