Sha256: 8600fc5cfb00b3922343137e0ced8d347f2a1e0f328c6e4018707cf4fb4db990

Contents?: true

Size: 416 Bytes

Versions: 10

Compression:

Stored size: 416 Bytes

Contents

# frozen_string_literal: true

class MoveLastConnectionToLastSignInAt < ActiveRecord::Migration[4.2]
  set_role "blog_content"

  class User < ActiveRecord::Base
  end

  def up
    User.find_each do |user|
      user.update_attribute(:last_sign_in_at, user.last_connection)
    end
  end

  def down
    User.find_each do |user|
      user.update_attribute(:last_connection, user.last_sign_in_at)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
HornsAndHooves-publify_core-10.5.0 db/migrate/20160108184201_move_last_connection_to_last_sign_in_at.rb
HornsAndHooves-publify_core-10.4.0 db/migrate/20160108184201_move_last_connection_to_last_sign_in_at.rb
HornsAndHooves-publify_core-10.3.0 db/migrate/20160108184201_move_last_connection_to_last_sign_in_at.rb
HornsAndHooves-publify_core-10.2.0 db/migrate/20160108184201_move_last_connection_to_last_sign_in_at.rb
HornsAndHooves-publify_core-10.1.1 db/migrate/20160108184201_move_last_connection_to_last_sign_in_at.rb
HornsAndHooves-publify_core-10.1.0 db/migrate/20160108184201_move_last_connection_to_last_sign_in_at.rb
HornsAndHooves-publify_core-10.0.3 db/migrate/20160108184201_move_last_connection_to_last_sign_in_at.rb
HornsAndHooves-publify_core-10.0.2 db/migrate/20160108184201_move_last_connection_to_last_sign_in_at.rb
HornsAndHooves-publify_core-10.0.1 db/migrate/20160108184201_move_last_connection_to_last_sign_in_at.rb
HornsAndHooves-publify_core-10.0.0 db/migrate/20160108184201_move_last_connection_to_last_sign_in_at.rb