Skip to content

Commit

Permalink
fixup! Scope for leaves
Browse files Browse the repository at this point in the history
  • Loading branch information
antstorm committed Jul 10, 2018
1 parent 7af5b6a commit 7e53201
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/ancestry/class_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -240,16 +240,16 @@ def primary_key_is_an_integer?
private

def sql_concat *parts
if ActiveRecord::Base.connection.adapter_name.downcase == 'sqlite'
if %w(sqlite sqlite3).include?(connection.adapter_name.downcase)
parts.join(' || ')
else
"CONCAT(#{parts.join(', ')})"
end
end

def sql_cast_as_text column
text_type = if ActiveRecord::Base.connection.adapter_name.downcase == 'mysql'
'CHAR(32)'
text_type = if %w(mysql mysql2).include?(connection.adapter_name.downcase)
'CHAR'
else
'TEXT'
end
Expand Down

0 comments on commit 7e53201

Please sign in to comment.