Sha256: 29c6e027cacea48eab784ad77dcc6f5ae61fefc4ed83582edfbb875d2aa76dba

Contents?: true

Size: 414 Bytes

Versions: 18

Compression:

Stored size: 414 Bytes

Contents

class UpgradeWebsiteRoleIid
  
  def self.up
    #insert data here
    Website.all.each do |w|
      old_role_iid = "website_#{w.name.underscore.gsub("'","").gsub(",","")}_access"

      r = SecurityRole.find_by_internal_identifier(old_role_iid)
      unless r.nil?
        r.internal_identifier = w.website_role_iid
        r.save
      end      
    end
  end
  
  def self.down
    #remove data here
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
knitkit-3.0.0 db/data_migrations/20121129185611_upgrade_website_role_iid.rb
knitkit-2.1.15 db/data_migrations/20121129185611_upgrade_website_role_iid.rb
knitkit-2.1.14 db/data_migrations/20121129185611_upgrade_website_role_iid.rb
knitkit-2.1.13 db/data_migrations/20121129185611_upgrade_website_role_iid.rb
knitkit-2.1.12 db/data_migrations/20121129185611_upgrade_website_role_iid.rb
knitkit-2.1.11 db/data_migrations/20121129185611_upgrade_website_role_iid.rb
knitkit-2.1.10 db/data_migrations/20121129185611_upgrade_website_role_iid.rb
knitkit-2.1.9 db/data_migrations/20121129185611_upgrade_website_role_iid.rb
knitkit-2.1.8 db/data_migrations/20121129185611_upgrade_website_role_iid.rb
knitkit-2.1.7 db/data_migrations/20121129185611_upgrade_website_role_iid.rb
knitkit-2.1.6 db/data_migrations/20121129185611_upgrade_website_role_iid.rb
knitkit-2.1.5 db/data_migrations/20121129185611_upgrade_website_role_iid.rb
knitkit-2.1.4 db/data_migrations/20121129185611_upgrade_website_role_iid.rb
knitkit-2.1.3 db/data_migrations/20121129185611_upgrade_website_role_iid.rb
knitkit-2.1.2 db/data_migrations/20121129185611_upgrade_website_role_iid.rb
knitkit-2.1.1 db/data_migrations/20121129185611_upgrade_website_role_iid.rb
knitkit-2.1.0 db/data_migrations/20121129185611_upgrade_website_role_iid.rb
knitkit-2.0.11 db/data_migrations/20121129185611_upgrade_website_role_iid.rb