1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/fixtures/essays.yml
Ryuta Kamizono 6187b7138c Fix rewhere to truly overwrite collided where clause by new where clause
```ruby
steve = Person.find_by(name: "Steve")
david = Author.find_by(name: "David")

relation = Essay.where(writer: steve)

# Before
relation.rewhere(writer: david).to_a # => []

# After
relation.rewhere(writer: david).to_a # => [david]
```

For now `rewhere` only works for truly column names, doesn't work for
alias attributes, nested conditions, associations.

To fix that, need to build new where clause first, and then get
attribute names from new where clause.
2020-05-05 11:45:29 +09:00

16 lines
301 B
YAML

david_modest_proposal:
name: A Modest Proposal
writer_type: Author
writer_id: David
category_id: General
author_id: David
mary_stay_home:
name: Stay Home
writer_type: Author
writer_id: Mary
steve_connecting_the_dots:
name: Connecting The Dots
writer_type: Man
writer_id: Steve