Module: NestedHasManyThrough::Reflection

Defined in:
lib/nested_has_many_through/reflection.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
# File 'lib/nested_has_many_through/reflection.rb', line 3

def self.included(base)
  base.send :alias_method_chain, :check_validity!, :nested_has_many_through
end

Instance Method Details

#check_validity_with_nested_has_many_through!Object



7
8
9
10
11
12
# File 'lib/nested_has_many_through/reflection.rb', line 7

def check_validity_with_nested_has_many_through!
  check_validity_without_nested_has_many_through!
rescue ActiveRecord::HasManyThroughSourceAssociationMacroError => e
  # now we permit has many through to a :though source
  raise e unless source_reflection.options[:through]
end