diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-01-09 18:09:01 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-09 18:09:01 +0900 |
commit | ea65d92f1924648e72f93bb0e8e5fc62a56d0bac (patch) | |
tree | 9e8ebde83d6f1fd2c0eaff195ee54c3f42e3ae88 /activerecord/lib/arel | |
parent | 69ca787bd26c0306cdfde25de76036686fc39f4f (diff) | |
download | rails-ea65d92f1924648e72f93bb0e8e5fc62a56d0bac.tar.gz rails-ea65d92f1924648e72f93bb0e8e5fc62a56d0bac.tar.bz2 rails-ea65d92f1924648e72f93bb0e8e5fc62a56d0bac.zip |
Enable `Lint/UselessAssignment` cop to avoid unused variable warnings (#34904)
* Enable `Lint/UselessAssignment` cop to avoid unused variable warnings
Since we've addressed the warning "assigned but unused variable"
frequently.
370537de05092aeea552146b42042833212a1acc
3040446cece8e7a6d9e29219e636e13f180a1e03
5ed618e192e9788094bd92c51255dda1c4fd0eae
76ebafe594fc23abc3764acc7a3758ca473799e5
And also, I've found the unused args in c1b14ad which raises no warnings
by the cop, it shows the value of the cop.
Diffstat (limited to 'activerecord/lib/arel')
-rw-r--r-- | activerecord/lib/arel/visitors/informix.rb | 3 | ||||
-rw-r--r-- | activerecord/lib/arel/visitors/oracle12.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/arel/visitors/to_sql.rb | 4 |
3 files changed, 4 insertions, 5 deletions
diff --git a/activerecord/lib/arel/visitors/informix.rb b/activerecord/lib/arel/visitors/informix.rb index 0a9713794e..208fa15aef 100644 --- a/activerecord/lib/arel/visitors/informix.rb +++ b/activerecord/lib/arel/visitors/informix.rb @@ -15,8 +15,9 @@ module Arel # :nodoc: all collector << "ORDER BY " collector = inject_join o.orders, collector, ", " end - collector = maybe_visit o.lock, collector + maybe_visit o.lock, collector end + def visit_Arel_Nodes_SelectCore(o, collector) collector = inject_join o.projections, collector, ", " if o.source && !o.source.empty? diff --git a/activerecord/lib/arel/visitors/oracle12.rb b/activerecord/lib/arel/visitors/oracle12.rb index b092aa95e0..9a7fe4d626 100644 --- a/activerecord/lib/arel/visitors/oracle12.rb +++ b/activerecord/lib/arel/visitors/oracle12.rb @@ -20,7 +20,7 @@ module Arel # :nodoc: all def visit_Arel_Nodes_SelectOptions(o, collector) collector = maybe_visit o.offset, collector collector = maybe_visit o.limit, collector - collector = maybe_visit o.lock, collector + maybe_visit o.lock, collector end def visit_Arel_Nodes_Limit(o, collector) diff --git a/activerecord/lib/arel/visitors/to_sql.rb b/activerecord/lib/arel/visitors/to_sql.rb index f9fe4404eb..b5a960ce68 100644 --- a/activerecord/lib/arel/visitors/to_sql.rb +++ b/activerecord/lib/arel/visitors/to_sql.rb @@ -208,14 +208,12 @@ module Arel # :nodoc: all end visit_Arel_Nodes_SelectOptions(o, collector) - - collector end def visit_Arel_Nodes_SelectOptions(o, collector) collector = maybe_visit o.limit, collector collector = maybe_visit o.offset, collector - collector = maybe_visit o.lock, collector + maybe_visit o.lock, collector end def visit_Arel_Nodes_SelectCore(o, collector) |