User
has_many :posts
has_many :post_tags, :through => :posts
PostTag
belong_to :post
belongs_to :tag
scope :distincttag, :select => ('distinct post_tags.tag_id')
with Rails 3.0.4, i get invalid SQL: SELECT post_tags.*, distinct tag_id...
at least one other person experienced the same problem: http://www.ruby-forum.com/topic/484938
feature or a bug?
thanks
Does not look like the right thing to put on a scope.
Maybe you are trying to accomplish this:
Edit: now that I know what you need:
Reference: http://blog.hasmanythrough.com/2006/5/6/through-gets-uniq