{"comment":{"created_at":"2011-10-14T15:30:58Z","body":"@airblade, please try updated patch.  Thanks!","updated_at":"2011-10-14T15:30:58Z","url":"https://api.github.com/repos/FooBarWidget/default_value_for/issues/comments/2407932","id":2407932,"user":{"gravatar_id":"9968b786345739e77c49dc09c4f6514c","avatar_url":"https://secure.gravatar.com/avatar/9968b786345739e77c49dc09c4f6514c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jrafanie","id":19339,"login":"jrafanie"}},"action":"created","issue":{"number":21,"created_at":"2011-10-10T19:52:27Z","pull_request":{"diff_url":"https://github.com/FooBarWidget/default_value_for/pull/21.diff","patch_url":"https://github.com/FooBarWidget/default_value_for/pull/21.patch","html_url":"https://github.com/FooBarWidget/default_value_for/pull/21"},"body":"this commit fixes #21\r\n\r\n1) Overriding default_values in a subclass are modifying the parent class.  The following fails on the last assert_equal because the subclass is modifying the parent class' value.\r\n\r\n```Ruby\r\ndefine_model_class(\"TestSuperClass\") do\r\n  default_value_for :number, 1234\r\nend\r\ndefine_model_class(\"TestClass\", \"TestSuperClass\") do\r\n  default_value_for :number, 5678\r\nend\r\n\r\nobject = TestClass.new\r\nassert_equal 5678, object.number\r\n\r\nobject = TestSuperClass.new\r\nassert_equal 1234, object.number\r\n```\r\n\r\n2) New default_values in a subclass are being added to the parent class.  The following fails because TestSuperClass.new tries to call .hello=, which doesn't exist.\r\n\r\n```Ruby\r\ndefine_model_class(\"TestSuperClass\") do\r\n  default_value_for :number, 1234\r\nend\r\ndefine_model_class(\"TestClass\", \"TestSuperClass\") do\r\n  default_value_for :hello, \"hi\"\r\n  attr_accessor :hello\r\nend\r\n\r\nassert_nothing_raised { TestSuperClass.new }\r\n```","comments":3,"title":"Fixed issues around subclassing","updated_at":"2011-10-14T15:30:58Z","url":"https://api.github.com/repos/FooBarWidget/default_value_for/issues/21","id":1867462,"assignee":null,"milestone":null,"closed_at":null,"user":{"gravatar_id":"9968b786345739e77c49dc09c4f6514c","avatar_url":"https://secure.gravatar.com/avatar/9968b786345739e77c49dc09c4f6514c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jrafanie","id":19339,"login":"jrafanie"},"html_url":"https://github.com/FooBarWidget/default_value_for/issues/21","labels":[],"state":"open"},"legacy":{"issue_id":1867462,"comment_id":2407932}}