Class: ZenCategory
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- ZenCategory
- Includes:
- RequiredUniqueName
- Defined in:
- app/models/zen_category.rb
Instance Method Summary collapse
Instance Method Details
#add_post(post) ⇒ Object
13 14 15 |
# File 'app/models/zen_category.rb', line 13 def add_post(post) post_zen_categories.create(post: post) end |
#post?(post) ⇒ Boolean
8 9 10 |
# File 'app/models/zen_category.rb', line 8 def post?(post) post_zen_categories.where(post: post).exists? end |
#remove_post(post) ⇒ Object
18 19 20 |
# File 'app/models/zen_category.rb', line 18 def remove_post(post) post_zen_categories.where(post: post).destroy_all end |