Class: Daylite::Base
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Daylite::Base
- Defined in:
- app/models/daylite.rb
Direct Known Subclasses
Contact, Organization, OrganizationTaskJoin, Project, ProjectTaskJoin, Role, RoleType, Task, User
Instance Method Summary collapse
- #method_missing(symbol, *args) ⇒ Object
-
#readonly? ⇒ Boolean
don’t allow to save Daylite::Base objects to DB.
Methods inherited from ActiveRecord::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(symbol, *args) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'app/models/daylite.rb', line 18 def method_missing(symbol, *args) guess_attribute = symbol.to_s.camelize(:lower).sub("Id", "ID") if result = attributes[guess_attribute] self.class.class_eval do define_method symbol do return attributes[guess_attribute] end end result else super end end |
Instance Method Details
#readonly? ⇒ Boolean
don’t allow to save Daylite::Base objects to DB
14 15 16 |
# File 'app/models/daylite.rb', line 14 def readonly? true end |