Module: ActiveRecordStash::ClassMethods
- Defined in:
- lib/active_record_stash.rb
Instance Method Summary collapse
Instance Method Details
#stash(*methods) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/active_record_stash.rb', line 43 def stash *methods = methods. .assert_valid_keys(:in) .symbolize_keys! unless serialized_column = [:in] raise ArgumentError, NO_TARGET_ERROR end self.stashed_attributes = {} self.stashed_attributes[serialized_column] = methods.map(&:to_sym) serialize serialized_column attr_accessor *methods end |