lib/avo/base_resource.rb in avo-1.24.2 vs lib/avo/base_resource.rb in avo-1.25.0
- old
+ new
@@ -141,19 +141,19 @@
if reflection.present?
# regular non-polymorphic association
# we're matching the reflection inverse_of foriegn key with the field's foreign_key
if field.is_a?(Avo::Fields::BelongsToField)
if field.respond_to?(:foreign_key) &&
- reflection.inverse_of.present? &&
- reflection.inverse_of.foreign_key == field.foreign_key
+ reflection.inverse_of.present? &&
+ reflection.inverse_of.foreign_key == field.foreign_key
is_valid = false
end
# polymorphic association
if field.respond_to?(:foreign_key) &&
- field.is_polymorphic? &&
- reflection.respond_to?(:polymorphic?) &&
- reflection.inverse_of.foreign_key == field.reflection.foreign_key
+ field.is_polymorphic? &&
+ reflection.respond_to?(:polymorphic?) &&
+ reflection.inverse_of.foreign_key == field.reflection.foreign_key
is_valid = false
end
end
end