Module: MaglevRecord::Validations
- Defined in:
- lib/maglev_record/validations.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(symbol, *args) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/maglev_record/validations.rb', line 7 def method_missing(symbol, *args) self.class.create_validations if self.respond_to?(symbol) send(symbol, *args) else super end end |
Class Method Details
.included(base) ⇒ Object
3 4 5 |
# File 'lib/maglev_record/validations.rb', line 3 def self.included(base) base.extend(self::ClassMethods) if self.constants.include? 'ClassMethods' end |