Class: Mobility::Plugins::ActiveRecord::Dirty::MethodsBuilder

Inherits:
Mobility::Plugins::ActiveModel::Dirty::MethodsBuilder show all
Defined in:
lib/mobility/plugins/active_record/dirty.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Mobility::Plugins::ActiveModel::Dirty::MethodsBuilder

#append_locale, handler_methods_module, #initialize, method_patterns, public_method_patterns

Constructor Details

This class inherits a constructor from Mobility::Plugins::ActiveModel::Dirty::MethodsBuilder

Class Method Details

.dirty_classObject


52
53
54
55
56
57
58
59
60
61
62
# File 'lib/mobility/plugins/active_record/dirty.rb', line 52

def dirty_class
  @dirty_class ||= (Class.new do
    # In earlier versions of Rails, these are needed to avoid an
    # exception when including the AR Dirty module outside of an
    # AR::Base class. Eventually we should be able to drop them.
    def self.after_create; end
    def self.after_update; end

    include ::ActiveRecord::AttributeMethods::Dirty
  end)
end

Instance Method Details

#included(model_class) ⇒ Object

Parameters:


45
46
47
48
49
# File 'lib/mobility/plugins/active_record/dirty.rb', line 45

def included(model_class)
  super

  model_class.include InstanceMethods
end