Class: Vindi::Customer

Inherits:
Model
  • Object
show all
Defined in:
lib/vindi/models/customer.rb

Overview

Customers

Examples:


customer = Vindi::Customer.find(1)
customer.subscriptions
customer.subscriptions.active

customer = Vindi::Customer.find_by(email: "[email protected]")
customer.name
customer.name = "Gandalf the White"
customer.save

Instance Method Summary collapse

Methods inherited from Model

#archive!, first, last, #valid?

Instance Method Details

#subscriptionsObject

has_many :subscriptions, class_name: “Vindi::Subscription”, parent_as_param: true, group_params_with: :query



25
26
27
# File 'lib/vindi/models/customer.rb', line 25

def subscriptions
  Vindi::Subscription.where(customer_id: id)
end