5 Ways to set Attributes in ActiveRecord
5 Ways to set Attributes in ActiveRecord
Method | Uses Default Accessor | Mass Assignment Protection | Saved to Database | Validations |
---|---|---|---|---|
attribute= | Yes | No | No | n/a |
write_attribute | No | No | No | n/a |
update_attribute | Yes | No | Yes | No |
attributes= | Yes | Yes1 | No | n/a |
update_attributes | Yes | Yes | Yes | Yes |