このメソッドをherokuで機能させるのに問題があります。ページを読み込もうとすると、上記のエラーメッセージが表示されます。以前の投稿で助けがありましたが、リファクタリングが機能していないようです。私が読んだことから、モデルのすべての列を検索とグループに含める必要があります..それは正しいですか?メソッドとスキーマは次のとおりです
方法
def self.popular_recipes
select('recipes.*, count(*) AS dish_count').
group('dish_name').
order('dish_count DESC')
end
スキーマ
create_table "recipes", :force => true do |t|
t.string "dish_name"
t.string "difficulty"
t.text "preperation_time"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "user_id"
t.string "avatar_file_name"
t.string "avatar_content_type"
t.integer "avatar_file_size"
t.datetime "avatar_updated_at"
t.integer "country_id"
t.string "category"
t.text "description"
end