App::Models::Subscription
Inherits PgORM::Timestamps < PgORM::Base < PgORM::Validators < PgORM::Table < PgORM::Persistence < PgORM::Associations < ActiveModel::Callbacks < ActiveModel::Validation < ActiveModel::Model < DB::Mappable < DB::Serializable < YAML::Serializable < JSON::Serializable < Reference < Object
Constants
macro level key => type
Constructors
Deserializes the given JSON in string_or_io into
an instance of self, assuming the JSON consists
of an JSON object with key root, and whose value is
the value to deserialize. Will not deserialise from
fields with mass_assign: false
class User < ActiveModel::Model
attribute name : String
attribute google_id : UUID, mass_assign: false
end
User.from_json(%({"main": {"name": "Jason", "google_id": "f6f70bfb-c882-446d-8758-7ce47db39620"}}), root: "main") # => #<User:0x103131b20 @name="Jason">
Serialize from a trusted JSON source
Serialize from a trusted YAML source
Initialize App::Models::Subscription from HTTP::Params.
Class methods
Returns all attribute keys.
Changefeed at row (if id passed) or whole table level.
Returns a ChangeFeed instance which can be used to invoke async callbacks via on or
use blocking Iterator via each method.
Instance methods
Generate code to apply default values
Assign to multiple attributes.
Assign to mulitple attributes via HTTP::Params.
Assign to multiple attributes from a model object
Assign each field from JSON if field exists in JSON and has changed in model
Uses the YAML parser as JSON is valid YAML
Returns a Hash of all attribute values
Returns a NamedTuple of all attribute values.
Check if any attributes have changed.
Returns a Hash with all changed attributes.
Serialize the set of changed attributes to JSON.
Serialize the set of changed attributes to JSON.
Serialize the set of changed attributes to YAML.
Serialize the set of changed attributes to YAML.
Reset changes for all attributes.
created_at getter
created_at setter
Assign instance variable to correct type
Returns a Tuple of the previous and the current value of an instance variable if it has changed
created_at's default value
Include created_at in the set of changed attributes, whether it has changed or not.
current_period_end getter
current_period_end setter
Assign instance variable to correct type
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include current_period_end in the set of changed attributes, whether it has changed or not.
current_period_start getter
current_period_start setter
Assign instance variable to correct type
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include current_period_start in the set of changed attributes, whether it has changed or not.
cutoff_grace_days getter
cutoff_grace_days setter
Assign instance variable to correct type
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include cutoff_grace_days in the set of changed attributes, whether it has changed or not.
id getter
Setters
id setter
Assign instance variable to correct type
Returns a Tuple of the previous and the current value of an instance variable if it has changed
id's default value
Include id in the set of changed attributes, whether it has changed or not.
next_invoice_at getter
next_invoice_at setter
Assign instance variable to correct type
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include next_invoice_at in the set of changed attributes, whether it has changed or not.
org_id getter
org_id setter
Assign instance variable to correct type
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include org_id in the set of changed attributes, whether it has changed or not.
payment_terms_days getter
payment_terms_days setter
Assign instance variable to correct type
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include payment_terms_days in the set of changed attributes, whether it has changed or not.
Returns a Hash of all attributes that can be persisted.
plan_id getter
plan_id setter
Assign instance variable to correct type
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include plan_id in the set of changed attributes, whether it has changed or not.
Reset each attribute to their previous values and clears all changes.
start_date getter
start_date setter
Assign instance variable to correct type
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include start_date in the set of changed attributes, whether it has changed or not.
state getter
state setter
Assign instance variable to correct type
Returns a Tuple of the previous and the current value of an instance variable if it has changed
Include state in the set of changed attributes, whether it has changed or not.
updated_at getter
updated_at setter
Assign instance variable to correct type
Returns a Tuple of the previous and the current value of an instance variable if it has changed
updated_at's default value
Include updated_at in the set of changed attributes, whether it has changed or not.
Validate that all non-nillable fields have values.