customer = Feedback.includes(:user).where("('created_at' >= ? and
'created_at' < ? and how_did_you_hear = ? and
users.user_type = ? )",date_start,date_end,value,"customer").count
This code match with all Feedbacks not only Feedback.user.user_type = “customer”
How can I fix this?
This could work: