You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello I'm facing the issue with inheritance, attributes are not being copied.
Ruby 2.3.1
model_attribute (3.1.1)
require'model_attribute'classPersonextendModelAttributeattribute:name,:stringattribute:last_name,:stringdefinitialize(attributes={})set_attributes(attributes)endendclassUser < Persondefinitialize(attributes={})super(attributes)self.name="This is an error"endendUser.attributes# nilUser.new({})# /Users/soto/.rvm/gems/ruby-2.3.1/gems/model_attribute-3.1.1/lib/model_attribute.rb:87:in `read_attribute': undefined method `include?' for nil:NilClass (NoMethodError)# from /Users/soto/.rvm/gems/ruby-2.3.1/gems/model_attribute-3.1.1/lib/model_attribute.rb:66:in `write_attribute'# from /Users/soto/.rvm/gems/ruby-2.3.1/gems/model_attribute-3.1.1/lib/model_attribute.rb:27:in `name='# from script.rb:17:in `initialize'# from script.rb:22:in `new'# from script.rb:22:in `<main>'
The text was updated successfully, but these errors were encountered:
I vaguely recall running into this issue a long time ago (two years ago) and setting out to fix it. I don't fully recall why I stopped, but I think I found that it was harder than I had thought to define what the desired behaviour actually was! If you would like to have a go, feel free to create a PR that defines and implements some sensible behaviour (don't forget rigorous specs!). You might want to start with my aborted attempt: 1f42a27.
Hello I'm facing the issue with inheritance, attributes are not being copied.
Ruby 2.3.1
model_attribute (3.1.1)
The text was updated successfully, but these errors were encountered: