Sha256: 1d0677c93b8c8e494e60e622addcdd2a57cbd54f0df835bdb626d2b2760fb98e

Contents?: true

Size: 931 Bytes

Versions: 6

Compression:

Stored size: 931 Bytes

Contents

class MoveUsersToProfiles < ActiveRecord::Migration
  class Profile < ActiveRecord::Base
    include BareMigration

    serialize :profiles
  end

  def self.up
    Profile.find_by_label("publisher").update_attributes(:modules => [:dashboard, :write, :content, :feedback, :profile ])
    Profile.find_by_label("contributor").update_attributes(:modules => [:dashboard, :profile ])
    Profile.find_by_label("admin").update_attributes(:modules => [:dashboard, :write, :content, :feedback, :themes, :sidebar, :users, :settings, :profile])
  end

  def self.down
    Profile.find_by_label("publisher").update_attributes(:modules => [:dashboard, :write, :content, :feedback, :users ])
    Profile.find_by_label("contributor").update_attributes(:modules => [:dashboard, :users ])
    Profile.find_by_label("admin").update_attributes(:modules => [:dashboard, :write, :content, :feedback, :themes, :sidebar, :users, :settings ])
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
typo-5.5 db/migrate/084_move_users_to_profiles.rb
typo-5.4.4 db/migrate/084_move_users_to_profiles.rb
typo-5.4.3 db/migrate/084_move_users_to_profiles.rb
typo-5.4.2 db/migrate/084_move_users_to_profiles.rb
typo-5.4.1 db/migrate/084_move_users_to_profiles.rb
typo-5.4 db/migrate/084_move_users_to_profiles.rb