Rename ldap_groups to ldap_group_links

parent b22546df
...@@ -21,7 +21,7 @@ class Group < Namespace ...@@ -21,7 +21,7 @@ class Group < Namespace
has_many :users, through: :users_groups has_many :users, through: :users_groups
has_many :project_group_links, dependent: :destroy has_many :project_group_links, dependent: :destroy
has_many :shared_projects, through: :project_group_links, source: :project has_many :shared_projects, through: :project_group_links, source: :project
has_many :ldap_groups, foreign_key: 'group_id' has_many :ldap_group_links, foreign_key: 'group_id'
validates :ldap_access, validates :ldap_access,
inclusion: { in: UsersGroup.group_access_roles.values }, inclusion: { in: UsersGroup.group_access_roles.values },
......
class LdapGroup < ActiveRecord::Base class LdapGroupLink < ActiveRecord::Base
belongs_to :group belongs_to :group
validates :cn, uniqueness: { scope: :group_id } validates :cn, uniqueness: { scope: :group_id }
......
class RenameLdapGroupToLdapGroupLink < ActiveRecord::Migration
def change
rename_table :ldap_groups, :ldap_group_links
end
end
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20140813090117) do ActiveRecord::Schema.define(version: 20140813133925) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
...@@ -128,7 +128,7 @@ ActiveRecord::Schema.define(version: 20140813090117) do ...@@ -128,7 +128,7 @@ ActiveRecord::Schema.define(version: 20140813090117) do
add_index "keys", ["user_id"], name: "index_keys_on_user_id", using: :btree add_index "keys", ["user_id"], name: "index_keys_on_user_id", using: :btree
create_table "ldap_groups", force: true do |t| create_table "ldap_group_links", force: true do |t|
t.string "cn", null: false t.string "cn", null: false
t.integer "group_access", null: false t.integer "group_access", null: false
t.integer "group_id", null: false t.integer "group_id", null: false
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment