Module: DependentRestrict

Defined in:
lib/dependent_restrict.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

VERSION =
'0.2.1'

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/dependent_restrict.rb', line 7

def self.included(base)
  super
  base.extend(ClassMethods)

  base.class_eval do
    class << self
      alias_method_chain :has_one, :restrict
      alias_method_chain :has_many, :restrict
      alias_method_chain :has_and_belongs_to_many, :restrict
    end
  end
end