How can I get the same result, but like posts method is a simple association?
I want to do this: "user.posts.active". Is the best solution to define :finder_sql ?
class User < ActiveRecord::Base
has_many :created_posts, class_name: Post.name, foreign_key: :creator_id
has_many :updated_posts, class_name: Post.name, foreign_key: :updater_id
def posts
(created_posts + updated_posts).flatten.uniq
end
end