You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With a typical belongs_to association you can use the nice shorthand
classFoo < ActiveRecord::Basebelongs_to:barendFoo.joins(:bar).to_sql# => "SELECT \"foos\".* FROM \"foos\" INNER JOIN \"bars\" ON \"bars\".\"bar_id\" = \"foos\".\"foo_id\""
With lookup_for, the association is never registered, and so the query has to be written out
classFoo < ActiveRecord::Baselookup_for:barendFoo.joins(:bar)# => #<ActiveRecord::ConfigurationError: Association named 'bar' was not found on Foo; perhaps you misspelled it?>
The text was updated successfully, but these errors were encountered:
This is related to #11 and my failed PR #18; it's another place where the only way I know of to make this happen is to hack into AR internals. Or, alternatively, pretty sure you could do this in ARel without too much of a headache.
With a typical
belongs_to
association you can use the nice shorthandWith
lookup_for
, the association is never registered, and so the query has to be written outThe text was updated successfully, but these errors were encountered: