Module: HairTrigger::Base
- Defined in:
- lib/hair_trigger/base.rb
Instance Attribute Summary collapse
-
#triggers ⇒ Object
readonly
Returns the value of attribute triggers.
Instance Method Summary collapse
Instance Attribute Details
#triggers ⇒ Object (readonly)
Returns the value of attribute triggers.
3 4 5 |
# File 'lib/hair_trigger/base.rb', line 3 def triggers @triggers end |
Instance Method Details
#trigger(name = nil, options = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/hair_trigger/base.rb', line 5 def trigger(name = nil, = {}) if name.is_a?(Hash) = name name = nil end [:compatibility] ||= ::HairTrigger::Builder::compatibility [:generated] = true @triggers ||= [] trigger = ::HairTrigger::Builder.new(name, ) @triggers << trigger trigger.on(table_name) end |