Module: Pluckers::Features::HasOneReflections

Includes:
Base::HasOneReflections
Included in:
Base
Defined in:
lib/pluckers/features/active_record_3_2/has_one_reflections.rb,
lib/pluckers/features/active_record_4_0/has_one_reflections.rb,
lib/pluckers/features/active_record_4_1/has_one_reflections.rb,
lib/pluckers/features/active_record_4_2/has_one_reflections.rb,
lib/pluckers/features/active_record_5_0/has_one_reflections.rb,
lib/pluckers/features/active_record_5_1/has_one_reflections.rb

Instance Method Summary collapse

Methods included from Base::HasOneReflections

#build_results, #configure_query

Instance Method Details

#active_record_has_one_reflection?(reflection) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
# File 'lib/pluckers/features/active_record_3_2/has_one_reflections.rb', line 7

def active_record_has_one_reflection? reflection
  reflection.is_a?(ActiveRecord::Reflection::AssociationReflection) &&
  (reflection.macro == :has_one)
end