Sha256: fa458c5e1c9d1938da9a772ec4d6c72084e04e8aba791bbbbc8c0bed77c5b6af

Contents?: true

Size: 341 Bytes

Versions: 68

Compression:

Stored size: 341 Bytes

Contents

class NullifyEmptyThoughtsColumns < ActiveRecord::Migration
  def up
    Thought.all.each do |thought|
      # force before_validation callback to run
      thought.valid?
      thought.update_columns(
        challenging_thought: thought.challenging_thought,
        act_as_if: thought.act_as_if
      )
    end
  end

  def down
  end
end

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
think_feel_do_engine-3.22.9 db/migrate/20150810204045_nullify_empty_thoughts_columns.rb
think_feel_do_engine-3.22.8 db/migrate/20150810204045_nullify_empty_thoughts_columns.rb
think_feel_do_engine-3.22.7 db/migrate/20150810204045_nullify_empty_thoughts_columns.rb
think_feel_do_engine-3.22.6 db/migrate/20150810204045_nullify_empty_thoughts_columns.rb
think_feel_do_engine-3.22.5 db/migrate/20150810204045_nullify_empty_thoughts_columns.rb
think_feel_do_engine-3.22.4 db/migrate/20150810204045_nullify_empty_thoughts_columns.rb
think_feel_do_engine-3.22.2 db/migrate/20150810204045_nullify_empty_thoughts_columns.rb
think_feel_do_engine-3.22.1 db/migrate/20150810204045_nullify_empty_thoughts_columns.rb
think_feel_do_engine-3.22.0 db/migrate/20150810204045_nullify_empty_thoughts_columns.rb
think_feel_do_engine-3.21.2 db/migrate/20150810204045_nullify_empty_thoughts_columns.rb
think_feel_do_engine-3.21.1 db/migrate/20150810204045_nullify_empty_thoughts_columns.rb
think_feel_do_engine-3.21.0 db/migrate/20150810204045_nullify_empty_thoughts_columns.rb
think_feel_do_engine-3.20.1 db/migrate/20150810204045_nullify_empty_thoughts_columns.rb
think_feel_do_engine-3.19.9 db/migrate/20150810204045_nullify_empty_thoughts_columns.rb
think_feel_do_engine-3.19.8 db/migrate/20150810204045_nullify_empty_thoughts_columns.rb
think_feel_do_engine-3.19.7 db/migrate/20150810204045_nullify_empty_thoughts_columns.rb
think_feel_do_engine-3.19.6 db/migrate/20150810204045_nullify_empty_thoughts_columns.rb
think_feel_do_engine-3.19.5 db/migrate/20150810204045_nullify_empty_thoughts_columns.rb
think_feel_do_engine-3.19.4 db/migrate/20150810204045_nullify_empty_thoughts_columns.rb
think_feel_do_engine-3.19.3 db/migrate/20150810204045_nullify_empty_thoughts_columns.rb