I have 2 tables. I use table prefix x_.
- User (table x_users)
- Comment (table x_comments)
I want to find out total count after inner join.
This query works fine.
User.joins(:comments).where(x_comments: {something: 1}).count
How can I remove x_ from where condition to make this call generic?
Models
class User < ActiveRecord::Base
has_many :comments, dependent: :destroy
end
class Comment < ActiveRecord::Base
attr_accessible :something
belongs_to :user
end