Reputation: 1312
I am trying to make use of Active Record Query Interface joins
I have the associations for the two models working correctly, but when I try to run this query...
Package.all :joins => :drugs
I receive the:
ArgumentError: wrong number of arguments (given 1, expected 0)
does anyone know why this might be?
Upvotes: 0
Views: 37
Reputation: 199
What version of Rails are you running? The documentation is pretty old (v2.3) and a lot has changed since then.
Try using Package.joins(:drugs).all
instead.
Upvotes: 2