Browse Source

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

eperez-timeinput
Jason Denney 11 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,
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

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)
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

2
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

1
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

2
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

Loading…
Cancel
Save