class CreateExtremeAasTables < ActiveRecord::Migration def change create_table :extreme_profiles do |t| t.timestamps end create_table :extreme_grants do |t| t.references :extreme_profile t.references :extreme_action t.boolean :volatile t.timestamps end create_table :extreme_actions do |t| t.references :actionable, :polymorphic => true t.timestamps end create_table :extreme_simple_actions do |t| #-------- t.string :controller_name t.string :action_name #-------- t.string :helper_name t.string :method_name #-------- t.timestamps end create_table :extreme_action_groups do |t| t.string :name t.boolean :volatile t.timestamps end create_table :extreme_action_edges do |t| t.integer :child_action_id t.integer :parent_action_id t.timestamps end ############## DEFAULT PROFILE ############## # default profile will have always id = 1 profile = ExtremeAas::ExtremeProfile.create :id => 1 grant = ExtremeAas::ExtremeActionGroup.create :name => 'default' profile.give_permission grant.super_action ############################################# end end