Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
class PopulateTables < ActiveRecord::Migration def self.up # Create Rights (Administrator) Right.create :name => '* All Title Actions', :controller => 'titles' Right.create :name => '* All Category Actions', :controller => 'catgories' Right.create :name => '* All User Actions', :controller => 'account' Right.create :name => '* All Role Actions', :controller => 'roles' Right.create :name => '* All Right Actions', :controller => 'right' # Create Rights (User) (Destruction) Right.create :name => 'Destroy Title', :controller => 'titles', :action => 'destroy' Right.create :name => 'Destroy Category', :controller => 'categories', :action => 'destroy' Right.create :name => 'Destroy User', :controller => 'account', :action => 'destroy' Right.create :name => 'Destroy Role', :controller => 'roles', :action => 'destroy' Right.create :name => 'Destroy Right', :controller => 'rights', :action => 'destroy' # Create Rights (User) (Creation) Right.create :name => 'Create Title', :controller => 'titles', :action => 'create' Right.create :name => 'Create Category', :controller => 'categories', :action => 'create' Right.create :name => 'Create User', :controller => 'account', :action => 'create' Right.create :name => 'Create Role', :controller => 'roles', :action => 'create' Right.create :name => 'Create Right', :controller => 'rights', :action => 'create' # Create Roles @administrator = Role.new do |admin| admin.name = "Administrator" admin.rights = Right.find(:all) admin.save end @category_moderator = Role.new do |cat_mod| cat_mod.name = "Category Moderator" cat_mod.rights = Right.find(:all, :conditions => "controller LIKE 'categories'") end @user = Role.new do |user| user.name = "User" user.rights = [] end # Create Two Users - Lee and Demo # # Create Category Structure # # Create Titles end def self.down end end
This paste will be private.
From the Design Piracy series on my blog: