Class: ActiveRecord::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/aws_onchange.rb

Class Method Summary collapse

Class Method Details

.aws_onchange(*args) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/aws_onchange.rb', line 6

def self.aws_onchange(*args)
			options = args.extract_options!

  cattr_accessor :aws_onchange_field
			cattr_accessor :aws_onchange_method
			cattr_accessor :aws_onchange_oncreate

  self.aws_onchange_field = (options[:checked_field] and options[:checked_field].respond_to?('each')?options[:checked_field]:[options])
			self.aws_onchange_method = (options[:method]?options[:method]:'update_cache')
			self.aws_onchange_oncreate = (options[:oncreate]?options[:oncreate]:false)
end