app/models/macro.rb
# Apply the macro instance to the provided domain
Apply the macro instance to the provided domain
Apply the macro instance to the provided domain
def apply_to( domain )
    Record.batch do
      macro_steps.each do |step|
        if step.action == 'create'
          macro_create( domain, step )
        elsif step.action == 'update'
          macro_change( domain, step )
        elsif step.action == 'remove'
          macro_remove( domain, step )
        elsif step.action == 'create_update'
          macro_create_update( domain, step )
        else
          raise ArgumentError, "Cannot process action: #{step.action} (#{step.inspect})"
        end
      end
    end
  end
def apply_to ( domain ) Record . batch do macro_steps . each do | step | if step . action == 'create' macro_create ( domain , step ) elsif step . action == 'update' macro_change ( domain , step ) elsif step . action == 'remove' macro_remove ( domain , step ) elsif step . action == 'create_update' macro_create_update ( domain , step ) else raise ArgumentError , "Cannot process action: #{step.action} (#{step.inspect})" end end end end
Apply the macro instance to the provided domain
Apply the macro instance to the provided domain
domain
<not_specific>