Class: Maquina::Plan
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Maquina::Plan
- 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.
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.
Scopes
search_full
-
Provides a search scope for Plan model, allowing searching by name with options for prefix matching and matching any word.
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.