fixes bug in protocol management

This commit is contained in:
zmagod 2017-01-27 11:01:44 +01:00
parent 0a6bb958a5
commit 61b260fb8a
2 changed files with 9 additions and 1 deletions

View file

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

View file

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