1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/lib/arel
eileencodes 27fb356360
Refactor invert predicate
Instead of doing a case statement here we can have each of the objects
respond to `invert`. This means that when adding new objects we don't
need to increase this case statement, it's more object oriented, and
let's be fair, it looks better too.

Aaron and I stumbled upon this while working on some performance
work in Arel.

I removed `random_object` from the invert test because we don't support
random objects. If you pass a random object to Arel, it should raise,
not be inverted.

Co-authored-by: Aaron Patterson <aaron.patterson@gmail.com>
2020-03-04 09:28:51 -05:00
..
attributes Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
collectors SQLString#compile is no longer used since 53521a9e39 2018-09-30 16:49:13 +09:00
nodes Refactor invert predicate 2020-03-04 09:28:51 -05:00
visitors Allow #nulls_first and #nulls_last in PostgreSQL 2019-12-31 15:59:59 -05:00
alias_predication.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
crud.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
delete_manager.rb Handle DELETE with LIMIT in Arel 2018-09-30 21:21:54 +09:00
errors.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
expressions.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
factory_methods.rb Make update_counters preparable 2018-09-28 04:14:15 +09:00
insert_manager.rb Get rid of Arel::Nodes::Values 2019-03-18 03:57:16 +09:00
math.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
nodes.rb Allow #nulls_first and #nulls_last in PostgreSQL 2019-12-31 15:59:59 -05:00
order_predications.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
predications.rb Move nil? check to open_ended? method 2020-01-06 22:06:14 -05:00
select_manager.rb Revert unused code and re-using query annotation for update_all and delete_all 2019-04-01 15:04:11 +09:00
table.rb Use private attr_reader in Arel 2018-09-30 15:24:17 +09:00
tree_manager.rb Revert unused code and re-using query annotation for update_all and delete_all 2019-04-01 15:04:11 +09:00
update_manager.rb Handle DELETE with LIMIT in Arel 2018-09-30 21:21:54 +09:00
visitors.rb Remove unused DepthFirst visitor 2019-06-15 23:20:16 +09:00
window_predications.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30