Module: Apiway::Model::ClassMethods
- Defined in:
- lib/apiway/model.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.extended(base) ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/apiway/model.rb', line 27 def self.extended( base ) base.class_eval do if self.ancestors.include? ActiveRecord::Base after_save :sync after_destroy :sync end end end |
Instance Method Details
#sync ⇒ Object
38 39 40 |
# File 'lib/apiway/model.rb', line 38 def sync Thread.current[ :changed_models ] << self end |