Created
October 30, 2014 17:51
-
-
Save anonymous/1bf11a3bad139cfceeeb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Base | |
class_attribute :my_array | |
self.my_array = ['some_shared'] | |
end | |
class Foo < Base | |
self.my_array << 'some_foo' | |
end | |
class Bar < Base | |
self.my_array << 'some_bar' | |
end | |
Foo.my_array #=> ['some_shared', 'some_foo', 'some_bar'] | |
Bar.my_array #=> ['some_shared', 'some_foo', 'some_bar'] | |
but I want | |
Foo.my_array #=> ['some_shared', 'some_foo'] | |
Bar.my_array #=> ['some_shared', 'some_bar'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment