Sha256: 342fbc695a6b30902ada828503c160819191b48ad16ffdc00b8fbe6e9993c56f

Contents?: true

Size: 454 Bytes

Versions: 10

Compression:

Stored size: 454 Bytes

Contents

class SiteClientAdminToManager < ActiveRecord::Migration

  class Relation::Admin < Relation; end

  def up
    admin = Relation::Admin.first

    if admin.present?
      rt = Tie.record_timestamps
      Tie.record_timestamps = false

      admin.ties.each do |t|
        t.relation = Relation::Manager.instance
        t.save!
      end

      Tie.record_timestamps = rt
    end
  end

  def down
    raise ActiveRecord::IrreversibleMigration
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
social_stream-2.2.2 oauth2_server/db/migrate/20130619134332_site_client_admin_to_manager.rb
social_stream-oauth2_server-2.2.2 db/migrate/20130619134332_site_client_admin_to_manager.rb
social_stream-2.2.1 oauth2_server/db/migrate/20130619134332_site_client_admin_to_manager.rb
social_stream-oauth2_server-2.2.1 db/migrate/20130619134332_site_client_admin_to_manager.rb
social_stream-2.2.0 oauth2_server/db/migrate/20130619134332_site_client_admin_to_manager.rb
social_stream-oauth2_server-2.2.0 db/migrate/20130619134332_site_client_admin_to_manager.rb
social_stream-2.1.1 oauth2_server/db/migrate/20130619134332_site_client_admin_to_manager.rb
social_stream-oauth2_server-2.1.1 db/migrate/20130619134332_site_client_admin_to_manager.rb
social_stream-2.1.0 oauth2_server/db/migrate/20130619134332_site_client_admin_to_manager.rb
social_stream-oauth2_server-2.1.0 db/migrate/20130619134332_site_client_admin_to_manager.rb