Class: Tag::PostsAssociation

Inherits:
ActiveRecord::Associations::HasManyAssociation
  • Object
show all
Defined in:
lib/ecrire/app/models/tag.rb

Instance Method Summary collapse

Instance Method Details

#scope(opts = {}) ⇒ Object



46
47
48
# File 'lib/ecrire/app/models/tag.rb', line 46

def scope(opts = {})
  Post.where('? = ANY (posts.tags)', owner.id).published.order('published_at DESC')
end