clemens/delocalize — pull request #50 by noniq (2012-08-16 23:17:03+00:00)
Title: Make sure class attributes are not shared between subclasses.

Using `class_attribute` with arrays or hashes is tricky, as mutating the object will change the object of the superclass (which may be shared by other subclasses, too).

I discovered this bug while experimenting with the metaprogramming stuff related to [my recent pull request](https://github.com/clemens/delocalize/pull/49) :-)

First I suspected that this bug was introduced by me in https://github.com/clemens/delocalize/pull/43 – but has been around before (the pull request only changed the original buggy behaviour to a slightly different buggy behaviour …).

On a side note: Using Delocalize with Mongoid is unaffected – the bug only appears when the `Delocalize::Delocalizable` module is included in `ActiveRecord::Base` and thus shared by subclasses.
With the overall trend going to “including instead of inheriting” (see [ActiveRecord::Model](https://github.com/rails/rails/blob/master/activerecord/lib/active_record/model.rb) for a prominent example) – what do you think about removing the ActiveRecord-Railtie entirely?