Class: Maquina::Plan
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Maquina::Plan
- Includes:
- SqliteSearch, PgSearch::Model
- Defined in:
- app/models/maquina/plan.rb
Overview
A class representing the Plan model in the Maquina module.
Attributes
price
-
The price of the Plan, represented as a monetary value with currency.
name
-
The name of the Plan.
organizations_count
-
Counter cache for the number of associated organizations.
Associations
organizations
-
Has many organizations. When plan is deleted, organization references are set to null.
Validations
price
-
Must be greater than or equal to 0 if the Plan is marked as free.
price
-
Must be greater than 0 if the Plan is not marked as free.
name
-
Must be present and unique.
Monetized Attributes
price
-
Uses the Money gem to handle currency and monetary calculations.
Usage
The Plan model represents a pricing plan in the Maquina module. To use the Plan model, create instances with valid attributes and use the provided methods and scopes for querying and manipulating plan data.
Class Method Summary collapse
Class Method Details
.searchable? ⇒ Boolean
42 43 44 |
# File 'app/models/maquina/plan.rb', line 42 def self.searchable? true end |