既存のコードに関連付けを追加できません。ActiveRecordクエリで内部結合を追加しましたが、構文エラーが発生しました
これは動作します:
PropertySpa.joins(:spa_results, :country)
とこの作品:
PropertySpa.joins(:spa_results => [:comp_status])
が、それはすべて私が動作しない欲しいものを得るために組み合わせを:
PropertySpa.joins(:spa_results => [:comp_status], :country)
は私にエラーを与えます:
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 ...
ありがとうございました。
あなたは 'PropertySpa.joins([{:spa_results => [:comp_status]}、:country)]'を試すことができますか? –