Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
94130133
Commit
94130133
authored
May 11, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Rails monkey-patches now that we're using Rails 4.2.6
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
e77a9a34
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
48 deletions
+0
-48
config/initializers/monkey_patch.rb
config/initializers/monkey_patch.rb
+0
-48
No files found.
config/initializers/monkey_patch.rb
deleted
100644 → 0
View file @
e77a9a34
## This patch is from rails 4.2-stable. Remove it when 4.2.6 is released
## https://github.com/rails/rails/issues/21108
module
ActiveRecord
module
ConnectionAdapters
class
AbstractMysqlAdapter
<
AbstractAdapter
# SHOW VARIABLES LIKE 'name'
def
show_variable
(
name
)
variables
=
select_all
(
"select @@
#{
name
}
as 'Value'"
,
'SCHEMA'
)
variables
.
first
[
'Value'
]
unless
variables
.
empty?
rescue
ActiveRecord
::
StatementInvalid
nil
end
# MySQL is too stupid to create a temporary table for use subquery, so we have
# to give it some prompting in the form of a subsubquery. Ugh!
def
subquery_for
(
key
,
select
)
subsubselect
=
select
.
clone
subsubselect
.
projections
=
[
key
]
subselect
=
Arel
::
SelectManager
.
new
(
select
.
engine
)
subselect
.
project
Arel
.
sql
(
key
.
name
)
# Materialized subquery by adding distinct
# to work with MySQL 5.7.6 which sets optimizer_switch='derived_merge=on'
subselect
.
from
subsubselect
.
distinct
.
as
(
'__active_record_temp'
)
end
end
end
end
module
ActiveRecord
module
ConnectionAdapters
class
MysqlAdapter
<
AbstractMysqlAdapter
ADAPTER_NAME
=
'MySQL'
.
freeze
# Get the client encoding for this database
def
client_encoding
return
@client_encoding
if
@client_encoding
result
=
exec_query
(
"select @@character_set_client"
,
'SCHEMA'
)
@client_encoding
=
ENCODINGS
[
result
.
rows
.
last
.
last
]
end
end
end
end
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