Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
d9010242
Commit
d9010242
authored
May 15, 2011
by
Holger Just
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[
#112
] Adapt database switches to use ChiliProject::Database
parent
82791440
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
user.rb
app/models/user.rb
+1
-1
20091227112908_change_wiki_contents_text_limit.rb
db/migrate/20091227112908_change_wiki_contents_text_limit.rb
+1
-1
No files found.
app/models/user.rb
View file @
d9010242
...
...
@@ -299,7 +299,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
=
(
ActiveRecord
::
Base
.
connection
.
adapter_name
=~
/mysql/i
)
?
'BINARY'
:
''
type_cast
=
(
ChiliProject
::
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
...
...
db/migrate/20091227112908_change_wiki_contents_text_limit.rb
View file @
d9010242
...
...
@@ -3,7 +3,7 @@ class ChangeWikiContentsTextLimit < ActiveRecord::Migration
# Migrates MySQL databases only
# Postgres would raise an error (see http://dev.rubyonrails.org/ticket/3818)
# Not fixed in Rails 2.3.5
if
ActiveRecord
::
Base
.
connection
.
adapter_name
=~
/mysql/i
if
ChiliProject
::
Database
.
mysql?
max_size
=
16
.
megabytes
change_column
:wiki_contents
,
:text
,
:text
,
:limit
=>
max_size
change_column
:wiki_content_versions
,
:data
,
:binary
,
:limit
=>
max_size
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment