Permalink
Browse files

Use available method rather than macro name checking

  • Loading branch information...
1 parent fe24ba8 commit 20405e516b031db4d8230014d1dcf9601ed0a0f8 @carlosantoniodasilva carlosantoniodasilva committed Aug 1, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/associations/through_association.rb
@@ -77,7 +77,7 @@ def foreign_key_present?
end
def ensure_mutable
- if source_reflection.macro != :belongs_to
+ unless source_reflection.belongs_to?
raise HasManyThroughCantAssociateThroughHasOneOrManyReflection.new(owner, reflection)
end
end

0 comments on commit 20405e5

Please sign in to comment.