aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/arel/collectors
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/arel/collectors')
-rw-r--r--activerecord/lib/arel/collectors/bind.rb4
-rw-r--r--activerecord/lib/arel/collectors/composite.rb6
-rw-r--r--activerecord/lib/arel/collectors/plain_string.rb5
-rw-r--r--activerecord/lib/arel/collectors/sql_string.rb6
-rw-r--r--activerecord/lib/arel/collectors/substitute_binds.rb7
5 files changed, 15 insertions, 13 deletions
diff --git a/activerecord/lib/arel/collectors/bind.rb b/activerecord/lib/arel/collectors/bind.rb
index d816aed90d..8d19e7446d 100644
--- a/activerecord/lib/arel/collectors/bind.rb
+++ b/activerecord/lib/arel/collectors/bind.rb
@@ -7,11 +7,11 @@ module Arel
@binds = []
end
- def << str
+ def <<(str)
self
end
- def add_bind bind
+ def add_bind(bind)
@binds << bind
self
end
diff --git a/activerecord/lib/arel/collectors/composite.rb b/activerecord/lib/arel/collectors/composite.rb
index 4f6156fe27..675a819596 100644
--- a/activerecord/lib/arel/collectors/composite.rb
+++ b/activerecord/lib/arel/collectors/composite.rb
@@ -8,13 +8,13 @@ module Arel
@right = right
end
- def << str
+ def <<(str)
left << str
right << str
self
end
- def add_bind bind, &block
+ def add_bind(bind, &block)
left.add_bind bind, &block
right.add_bind bind, &block
self
@@ -26,7 +26,7 @@ module Arel
protected
- attr_reader :left, :right
+ attr_reader :left, :right
end
end
end
diff --git a/activerecord/lib/arel/collectors/plain_string.rb b/activerecord/lib/arel/collectors/plain_string.rb
index 1e8d2a2152..b98802c44a 100644
--- a/activerecord/lib/arel/collectors/plain_string.rb
+++ b/activerecord/lib/arel/collectors/plain_string.rb
@@ -1,16 +1,17 @@
# frozen_string_literal: true
+
module Arel
module Collectors
class PlainString
def initialize
- @str = ''.dup
+ @str = "".dup
end
def value
@str
end
- def << str
+ def <<(str)
@str << str
self
end
diff --git a/activerecord/lib/arel/collectors/sql_string.rb b/activerecord/lib/arel/collectors/sql_string.rb
index bcb941f6d4..78c9e48aab 100644
--- a/activerecord/lib/arel/collectors/sql_string.rb
+++ b/activerecord/lib/arel/collectors/sql_string.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require 'arel/collectors/plain_string'
+require "arel/collectors/plain_string"
module Arel
module Collectors
@@ -10,13 +10,13 @@ module Arel
@bind_index = 1
end
- def add_bind bind
+ def add_bind(bind)
self << yield(@bind_index)
@bind_index += 1
self
end
- def compile bvs
+ def compile(bvs)
value
end
end
diff --git a/activerecord/lib/arel/collectors/substitute_binds.rb b/activerecord/lib/arel/collectors/substitute_binds.rb
index 99d2215aaa..ee6635f914 100644
--- a/activerecord/lib/arel/collectors/substitute_binds.rb
+++ b/activerecord/lib/arel/collectors/substitute_binds.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Arel
module Collectors
class SubstituteBinds
@@ -7,12 +8,12 @@ module Arel
@delegate = delegate_collector
end
- def << str
+ def <<(str)
delegate << str
self
end
- def add_bind bind
+ def add_bind(bind)
self << quoter.quote(bind)
end
@@ -22,7 +23,7 @@ module Arel
protected
- attr_reader :quoter, :delegate
+ attr_reader :quoter, :delegate
end
end
end