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/active_record/relation
Sean Doyle 98ee2a40bf Support delegators in query Predicate building
Prior to this commit, queries specifying objects as values like
`where(id: user)` and `where(author: user)` would only successfully
serialize to a SQL query if the value (i.e. `user` in the case of these
examples) were an instance of an `ActiveRecord::Base` descendant.

In applications that use decorators (either via `SimpleDelegator`,
`delegate_missing_to`, or other means), this required conversion can be
burdensome.

This commit modifies the `PredicateBuilder`, replacing class based
comparison conditionals with calls to `#respond_to?`.
2020-11-09 14:51:50 -05:00
..
batches Return rows affected from batched update_all and delete_all 2020-10-03 18:27:26 +01:00
predicate_builder Support delegators in query Predicate building 2020-11-09 14:51:50 -05:00
batches.rb Simplify apply_{start,finish}_limit 2020-07-25 09:38:00 +09:00
calculations.rb count, avarage, maximum, minimum, and sum are defined as public methods in Arel::Expressions 2020-10-02 21:45:58 +09:00
delegation.rb Allow define scope for Ruby reserved keywords 2020-05-14 21:39:39 +09:00
finder_methods.rb Avoid query from exists? on contradictory relation 2020-10-14 12:30:10 -07:00
from_clause.rb
merger.rb Relation methods are public 2020-10-02 21:36:35 +09:00
predicate_builder.rb Support delegators in query Predicate building 2020-11-09 14:51:50 -05:00
query_attribute.rb
query_methods.rb where.not now generates NAND predicates instead of NOR 2020-10-30 00:25:35 +00:00
record_fetch_warning.rb
spawn_methods.rb Set the inverse record on find with multiple ids from has_many association 2020-11-05 23:26:56 +09:00
where_clause.rb where.not now generates NAND predicates instead of NOR 2020-10-30 00:25:35 +00:00