From a083ed715b3fec09f758f9ee80b9ec408d73f693 Mon Sep 17 00:00:00 2001 From: Jason Denney Date: Wed, 24 Apr 2013 07:56:02 -0400 Subject: [PATCH] Renamed UserRoles to UserRole Joins, Needed ID column in user_role_joins table --- app/components/app_tab_panel.rb | 3 +-- app/components/{user_roles.rb => user_role_joins.rb} | 6 +++--- app/models/user_role_join.rb | 2 +- db/migrate/20130423231937_alter_user_roles.rb | 1 - db/schema.rb | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) rename app/components/{user_roles.rb => user_role_joins.rb} (54%) diff --git a/app/components/app_tab_panel.rb b/app/components/app_tab_panel.rb index 60fbb4f..6a0daed 100644 --- a/app/components/app_tab_panel.rb +++ b/app/components/app_tab_panel.rb @@ -37,7 +37,7 @@ class AppTabPanel < Netzke::Basepack::TabPanel wrappedComponent: :transactions_border, title: "Transactions"}, :logs, - :user_roles + :user_role_joins ] end @@ -48,7 +48,6 @@ class AppTabPanel < Netzke::Basepack::TabPanel self.class.component item[:wrappedComponent] end end - c.prevent_header = true c.tbar = [:sign_out] c.items = @@app_tab_panel_items diff --git a/app/components/user_roles.rb b/app/components/user_role_joins.rb similarity index 54% rename from app/components/user_roles.rb rename to app/components/user_role_joins.rb index bd81705..40442a1 100644 --- a/app/components/user_roles.rb +++ b/app/components/user_role_joins.rb @@ -1,10 +1,10 @@ -class UserRoles < Netzke::Basepack::Grid - +class UserRoleJoins < Netzke::Basepack::Grid def configure(c) super c.model = "UserRoleJoin" c.title = "User Roles" - #c.columns = [ :user__first_name, :role__role, :created_at, :updated_at, :ends ] + c.columns = [ :user__first_name, :role__role, :created_at, :updated_at, :ends ] + #c.columns = [ :user__first_name] end #override with nil to remove actions diff --git a/app/models/user_role_join.rb b/app/models/user_role_join.rb index f15c109..64b961a 100644 --- a/app/models/user_role_join.rb +++ b/app/models/user_role_join.rb @@ -1,5 +1,5 @@ class UserRoleJoin < ActiveRecord::Base - #set_table_name :user_role_joins + set_table_name :user_role_joins attr_accessible :role_id, :user_id belongs_to :user diff --git a/db/migrate/20130423231937_alter_user_roles.rb b/db/migrate/20130423231937_alter_user_roles.rb index bc046c1..43f4b82 100644 --- a/db/migrate/20130423231937_alter_user_roles.rb +++ b/db/migrate/20130423231937_alter_user_roles.rb @@ -3,7 +3,6 @@ class AlterUserRoles < ActiveRecord::Migration rename_table :user_roles, :user_role_joins change_table :user_role_joins do |t| t.rename :role, :role_id - t.remove :id end end end diff --git a/db/schema.rb b/db/schema.rb index 6376f3b..c6d3273 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -154,7 +154,7 @@ ActiveRecord::Schema.define(:version => 20130424005701) do t.datetime "updated_at", :null => false end - create_table "user_role_joins", :id => false, :force => true do |t| + create_table "user_role_joins", :force => true do |t| t.string "role_id" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false