Module: Normatron::Extensions::ActiveRecord

Defined in:
lib/normatron/extensions/active_record.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Constant Summary collapse

ORM_CLASS =
::ActiveRecord::Base

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/normatron/extensions/active_record.rb', line 9

def self.included(base)
  base.instance_eval do
    extend ClassMethods
    include InstanceMethods
    before_validation :apply_normalizations

    class << self
      attr_accessor :normalize_rules
      alias :normalize_filters :normalize_rules
      alias :normalize_filters= :normalize_rules=
    end
  end
end