Keine Beschreibung http://j1x-huginn.herokuapp.com

20140722131220_convert_efa_skip_agent.rb 657B

    class ConvertEfaSkipAgent < ActiveRecord::Migration def up Agent.where(type: 'Agents::EventFormattingAgent').each do |agent| agent.options_will_change! unless agent.options.delete('skip_agent').to_s == 'true' agent.options['instructions'] = { 'agent' => '{{agent.type}}' }.update(agent.options['instructions'] || {}) end agent.save! end end def down Agent.where(type: 'Agents::EventFormattingAgent').each do |agent| agent.options_will_change! agent.options['skip_agent'] = (agent.options['instructions'] || {})['agent'] == '{{agent.type}}' agent.save! end end end