Class: PostGroupTag
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- PostGroupTag
- Includes:
- NestedPriority
- Defined in:
- app/models/post_group_tag.rb
Overview
Class Method Summary collapse
Class Method Details
.[](slug) ⇒ Object
27 28 29 30 31 |
# File 'app/models/post_group_tag.rb', line 27 def self.[](slug) post_group = slug.is_a?(PostGroup) ? slug : PostGroup[slug] where(post_group: post_group).ordered_by_priority.map(&:post_tag) end |
.siblings(entity) ⇒ Object
22 23 24 |
# File 'app/models/post_group_tag.rb', line 22 def self.siblings(entity) where(post_group_id: entity.post_group_id) end |