Class: Customer
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Customer
- Defined in:
- lib/generators/ifd_tools/install/templates/models/customer.rb
Constant Summary collapse
- Statuses =
%w(active banned pending)
Instance Method Summary collapse
- #activate! ⇒ Object
- #active? ⇒ Boolean
- #deactivate! ⇒ Object
- #display_name ⇒ Object
- #full_name ⇒ Object
- #to_param ⇒ Object
Instance Method Details
#activate! ⇒ Object
42 43 44 |
# File 'lib/generators/ifd_tools/install/templates/models/customer.rb', line 42 def activate! update_attribute :status, "active" end |
#active? ⇒ Boolean
50 51 52 |
# File 'lib/generators/ifd_tools/install/templates/models/customer.rb', line 50 def active? status == "active" end |
#deactivate! ⇒ Object
46 47 48 |
# File 'lib/generators/ifd_tools/install/templates/models/customer.rb', line 46 def deactivate! update_attribute :status, "banned" end |
#display_name ⇒ Object
34 35 36 |
# File 'lib/generators/ifd_tools/install/templates/models/customer.rb', line 34 def display_name full_name end |
#full_name ⇒ Object
30 31 32 |
# File 'lib/generators/ifd_tools/install/templates/models/customer.rb', line 30 def full_name "#{first_name} #{last_name}" end |
#to_param ⇒ Object
38 39 40 |
# File 'lib/generators/ifd_tools/install/templates/models/customer.rb', line 38 def to_param url end |