Class: User
- Inherits:
-
LazyRecord
- Object
- Studio54::Base
- LazyRecord
- User
- Defined in:
- app/models/user.rb
Constant Summary
Constants inherited from LazyRecord
LazyRecord::AssociationNotFound, LazyRecord::RecordNotFound
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#humor ⇒ Object
Returns the value of attribute humor.
Instance Method Summary collapse
Methods inherited from LazyRecord
all, all_attributes, #attributes, attributes, belongs_to_attributes, #build_associated, #build_from_params!, db_try, #destroy, find, find_by, inherited, #initialize, method_missing, nested_attributes, tbl_attr_accessor, #update_attributes
Methods inherited from Studio54::Base
require_all_models, require_models
Constructor Details
This class inherits a constructor from LazyRecord
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
6 7 8 |
# File 'app/models/user.rb', line 6 def email @email end |
#humor ⇒ Object
Returns the value of attribute humor.
5 6 7 |
# File 'app/models/user.rb', line 5 def humor @humor end |
Instance Method Details
#age_greater_than_18 ⇒ Object
20 21 22 |
# File 'app/models/user.rb', line 20 def age_greater_than_18 errors.add(:age, "must be greater than 18") if self.age.to_i <= 18 end |
#drink ⇒ Object
28 29 30 31 32 |
# File 'app/models/user.rb', line 28 def drink run_callbacks :drink do "mmm" end end |
#name_not_blank ⇒ Object
16 17 18 |
# File 'app/models/user.rb', line 16 def name_not_blank errors.add(:name, "can't be blank") if self.name.blank? end |
#save ⇒ Object
39 40 41 42 43 |
# File 'app/models/user.rb', line 39 def save run_callbacks :save do super end end |