Browse Source

Renamed UserRoles to UserRole Joins, Needed ID column in user_role_joins table

eperez-timeinput
Jason Denney 12 years ago
parent
commit
a083ed715b
  1. 3
      app/components/app_tab_panel.rb
  2. 6
      app/components/user_role_joins.rb
  3. 2
      app/models/user_role_join.rb
  4. 1
      db/migrate/20130423231937_alter_user_roles.rb
  5. 2
      db/schema.rb

3
app/components/app_tab_panel.rb

@ -37,7 +37,7 @@ class AppTabPanel < Netzke::Basepack::TabPanel
wrappedComponent: :transactions_border, wrappedComponent: :transactions_border,
title: "Transactions"}, title: "Transactions"},
:logs, :logs,
:user_roles :user_role_joins
] ]
end end
@ -48,7 +48,6 @@ class AppTabPanel < Netzke::Basepack::TabPanel
self.class.component item[:wrappedComponent] self.class.component item[:wrappedComponent]
end end
end end
c.prevent_header = true c.prevent_header = true
c.tbar = [:sign_out] c.tbar = [:sign_out]
c.items = @@app_tab_panel_items c.items = @@app_tab_panel_items

6
app/components/user_roles.rb → app/components/user_role_joins.rb

@ -1,10 +1,10 @@
class UserRoles < Netzke::Basepack::Grid class UserRoleJoins < Netzke::Basepack::Grid
def configure(c) def configure(c)
super super
c.model = "UserRoleJoin" c.model = "UserRoleJoin"
c.title = "User Roles" 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 end
#override with nil to remove actions #override with nil to remove actions

2
app/models/user_role_join.rb

@ -1,5 +1,5 @@
class UserRoleJoin < ActiveRecord::Base class UserRoleJoin < ActiveRecord::Base
#set_table_name :user_role_joins set_table_name :user_role_joins
attr_accessible :role_id, :user_id attr_accessible :role_id, :user_id
belongs_to :user belongs_to :user

1
db/migrate/20130423231937_alter_user_roles.rb

@ -3,7 +3,6 @@ class AlterUserRoles < ActiveRecord::Migration
rename_table :user_roles, :user_role_joins rename_table :user_roles, :user_role_joins
change_table :user_role_joins do |t| change_table :user_role_joins do |t|
t.rename :role, :role_id t.rename :role, :role_id
t.remove :id
end end
end end
end end

2
db/schema.rb

@ -154,7 +154,7 @@ ActiveRecord::Schema.define(:version => 20130424005701) do
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
end 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.string "role_id"
t.datetime "created_at", :null => false t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false

Loading…
Cancel
Save