solnic / virtus

[DISCONTINUED ] Attributes on Steroids for Plain Old Ruby Objects
MIT License
3.77k stars 229 forks source link

escaping reserved "attributes" #206

Closed alex-zige closed 11 years ago

alex-zige commented 11 years ago

I wonder if there's a way to use reserved "attributes", for instance, i would like to do have an attributes called "attributes". but seems not working :(

class MyModel include Virtus.model attribute :attributes end

Any thoughts?

solnic commented 11 years ago

Yes it is now possible if you disable mass-assignment:

class MyModel
  include Virtus.model(:mass_assignment => false)

  attribute :attributes
end