module Apiway::Model::ClassMethods
Public Class Methods
extended( base )
click to toggle source
# 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
Public Instance Methods
sync()
click to toggle source
# File lib/apiway/model.rb, line 38 def sync Thread.current[ :changed_models ] << self end