Module: SmsOnRails::ActsAsSubstitutable::ClassMethods
- Defined in:
- lib/sms_on_rails/activerecord_extensions/acts_as_substitutable.rb
Instance Method Summary collapse
Instance Method Details
#acts_as_substitutable(method, options = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/sms_on_rails/activerecord_extensions/acts_as_substitutable.rb', line 12 def acts_as_substitutable(method, ={}) defaults = {:time => Proc.new {|rec| Time.now.to_s(:db) }} class_eval do [method.to_sym] = defaults.merge(||{}) def clear_substituted_params .keys.each{|method| instance_variable_set("@#{method}", nil)} end end acts_as_substitutable_instance_methods(method) end |