app/models/lato_blog/post.rb in lato_blog-2.1.2 vs app/models/lato_blog/post.rb in lato_blog-2.2.0
- old
+ new
@@ -27,9 +27,14 @@
has_many :category_relations, foreign_key: :lato_blog_post_id,
class_name: 'LatoBlog::CategoryPost',
dependent: :destroy
has_many :categories, through: :category_relations
+ has_many :tag_relations, foreign_key: :lato_blog_post_id,
+ class_name: 'LatoBlog::TagPost',
+ dependent: :destroy
+ has_many :tags, through: :tag_relations
+
# Scopes:
scope :published, -> { where(meta_status: BLOG_POSTS_STATUS[:published]) }
scope :drafted, -> { where(meta_status: BLOG_POSTS_STATUS[:drafted]) }
scope :deleted, -> { where(meta_status: BLOG_POSTS_STATUS[:deleted]) }