mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-09 14:46:47 +08:00
fixes bug in protocol management
This commit is contained in:
parent
0a6bb958a5
commit
61b260fb8a
2 changed files with 9 additions and 1 deletions
|
@ -127,7 +127,7 @@ class ProtocolsDatatable < AjaxDatatablesRails::Base
|
||||||
if @type == :public
|
if @type == :public
|
||||||
records =
|
records =
|
||||||
records
|
records
|
||||||
.joins('LEFT OUTER JOIN users ON users.id = protocols.added_by_id"')
|
.joins('LEFT OUTER JOIN users ON users.id = protocols.added_by_id')
|
||||||
.where('protocols.protocol_type = ?',
|
.where('protocols.protocol_type = ?',
|
||||||
Protocol.protocol_types[:in_repository_public])
|
Protocol.protocol_types[:in_repository_public])
|
||||||
elsif @type == :private
|
elsif @type == :private
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
class RenameOrganizationToTeam < ActiveRecord::Migration
|
class RenameOrganizationToTeam < ActiveRecord::Migration
|
||||||
def up
|
def up
|
||||||
|
unless ActiveRecord::Base.connection.table_exists?('organizations') &&
|
||||||
|
ActiveRecord::Base.connection.table_exists?('user_organizations')
|
||||||
|
return
|
||||||
|
end
|
||||||
rename_table :organizations, :teams
|
rename_table :organizations, :teams
|
||||||
rename_table :user_organizations, :user_teams
|
rename_table :user_organizations, :user_teams
|
||||||
|
|
||||||
|
@ -17,6 +21,10 @@ class RenameOrganizationToTeam < ActiveRecord::Migration
|
||||||
end
|
end
|
||||||
|
|
||||||
def down
|
def down
|
||||||
|
unless ActiveRecord::Base.connection.table_exists?('teams') &&
|
||||||
|
ActiveRecord::Base.connection.table_exists?('user_teams')
|
||||||
|
return
|
||||||
|
end
|
||||||
rename_table :teams, :organizations
|
rename_table :teams, :organizations
|
||||||
rename_table :user_teams, :user_organizations
|
rename_table :user_teams, :user_organizations
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue