Change {Chili => Open}Project::Database usages

Signed-off-by: Alex Coles <alex@alexbcoles.com>
pull/2476/head
Alex Coles 10 years ago
parent 2f5ae12a91
commit 45b75558bb
  1. 2
      app/models/principal.rb
  2. 2
      app/models/user.rb
  3. 2
      db/migrate/20120731091543_use_the_full_sti_class_names_for_repositories.rb

@ -51,7 +51,7 @@ class Principal < ActiveRecord::Base
lastnamefirstname = "((lastname || ' ') || firstname)"
# special concat for mysql
if ChiliProject::Database.mysql?
if OpenProject::Database.mysql?
firstnamelastname = "CONCAT(CONCAT(firstname, ' '), lastname)"
lastnamefirstname = "CONCAT(CONCAT(lastname, ' '), firstname)"
end

@ -486,7 +486,7 @@ class User < Principal
# version. Exact matches will be given priority.
def self.find_by_login(login)
# force string comparison to be case sensitive on MySQL
type_cast = (ChiliProject::Database.mysql?) ? 'BINARY' : ''
type_cast = (OpenProject::Database.mysql?) ? 'BINARY' : ''
# First look for an exact match
user = first(conditions: ["#{type_cast} login = ?", login])
# Fail over to case-insensitive if none was found

@ -32,7 +32,7 @@ class UseTheFullStiClassNamesForRepositories < ActiveRecord::Migration
concatenation = "('Repository::' || type)"
# special concat for mysql
if ChiliProject::Database.mysql?
if OpenProject::Database.mysql?
concatenation = "CONCAT('Repository::', type)"
end

Loading…
Cancel
Save