Module: AttrReadwrite::ActiveRecordExtensions::ClassMethods
- Defined in:
- lib/attr_readwrite/active_record_extensions.rb
Instance Method Summary collapse
Instance Method Details
#attr_readwrite(*attr_names) ⇒ Object
11 12 13 14 |
# File 'lib/attr_readwrite/active_record_extensions.rb', line 11 def attr_readwrite( *attr_names ) readwrite_attr_names = Array( attr_names ).map( &:to_s ) attr_readonly *(column_names - readwrite_attr_names - %w(id created_at updated_at)) end |
#readwrite_attributes ⇒ Object
16 17 18 |
# File 'lib/attr_readwrite/active_record_extensions.rb', line 16 def readwrite_attributes column_names - readonly_attributes.to_a end |