Class: Unidom::Category::Categorizing
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Unidom::Category::Categorizing
- Includes:
- Unidom::Common::Concerns::ModelExtension
- Defined in:
- app/models/unidom/category/categorizing.rb
Overview
Categorizing 是分类(category)和被分类项(categorized)之间的关联关系。
Class Method Summary collapse
Class Method Details
.categorize!(categorized, into: nil, at: Time.now) ⇒ Object
16 17 18 |
# File 'app/models/unidom/category/categorizing.rb', line 16 def self.categorize!(categorized, into: nil, at: Time.now) categorized_is(categorized).category_is(into).valid_at.alive.first_or_create! elemental: true, opened_at: at end |