Reputation: 1827
I'm having trouble adding an association to some existing code.
This works:
PropertySpa.joins(:spa_results, :country)
and this works:
PropertySpa.joins(:spa_results => [:comp_status])
but combining it all to get what I want doesn't work:
PropertySpa.joins(:spa_results => [:comp_status], :country)
gives me error:
SyntaxError: (irb):18: syntax error, unexpected ')', expecting => from /home/vagrant/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.5/lib/rails/commands/console.rb:110:in
start' from /home/vagrant/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.5/lib/rails/commands/console.rb:9:in
start' from /home/vagrant/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:68:in `console ...
Thanks for any assistance.
Upvotes: 0
Views: 130
Reputation: 36860
Try it this way.
PropertySpa.joins(:country, :spa_results => [:comp_status])
Most methods are written to expect implicit hashes to be the last arguments of a method.
Upvotes: 0