module StripeLocal class Transfer < ActiveRecord::Base include ObjectAdapter has_one :transaction, as: :source self.primary_key = :id time_writer :date def metadata= so MultiJson.dump so.to_hash end def metadata MultiJson.load read_attribute( :metadata ), symbolize_keys: true end class<(x){attribute_method? x} then k.to_sym else next end h[key] = v end end end #=!=#>>> # string :id # integer :amount # datetime :date # string :status # string :transaction_id # string :description # text :metadata #=ยก=#>>> end end