Class: ActiveRecord::Base
- Inherits:
-
Object
- Object
- ActiveRecord::Base
- Defined in:
- lib/hooks/helpers/ActiveRecord.rb
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_id, *args, &block) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/hooks/helpers/ActiveRecord.rb', line 2 def method_missing(method_id, *args, &block) begin super rescue #needs to be less crude #intention here is to trap RAILS failure when it cannot find/build an accessor method #for a class property #this will be the case with IAB because it only builds hashes that have values #so properties in the data model that do not have values in an instance record #in the DB will not result in an entry to the hash that defines the instance and hence #RAILS will not be able to build a method via it's method missing with more sophisication end end |