mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-27 01:05:21 +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
|
||||
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 = ?',
|
||||
Protocol.protocol_types[:in_repository_public])
|
||||
elsif @type == :private
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
class RenameOrganizationToTeam < ActiveRecord::Migration
|
||||
def up
|
||||
unless ActiveRecord::Base.connection.table_exists?('organizations') &&
|
||||
ActiveRecord::Base.connection.table_exists?('user_organizations')
|
||||
return
|
||||
end
|
||||
rename_table :organizations, :teams
|
||||
rename_table :user_organizations, :user_teams
|
||||
|
||||
|
@ -17,6 +21,10 @@ class RenameOrganizationToTeam < ActiveRecord::Migration
|
|||
end
|
||||
|
||||
def down
|
||||
unless ActiveRecord::Base.connection.table_exists?('teams') &&
|
||||
ActiveRecord::Base.connection.table_exists?('user_teams')
|
||||
return
|
||||
end
|
||||
rename_table :teams, :organizations
|
||||
rename_table :user_teams, :user_organizations
|
||||
|
||||
|
|
Loading…
Reference in a new issue