Skip to content

Commit

Permalink
Fix column names on Customer model
Browse files Browse the repository at this point in the history
@byroot 

This fix replaces lingering instances of a "name" column for the Customer model that was previously changed to "first_name".  Thank you!
  • Loading branch information
dm-murphy committed Jul 27, 2021
1 parent 796aba1 commit f73d9c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions guides/source/active_record_querying.md
Expand Up @@ -2038,7 +2038,7 @@ SELECT DISTINCT status FROM orders
=> ["shipped", "being_packed", "cancelled"]
irb> Customer.pluck(:id, :first_name)
SELECT customers.id, customers.name FROM customers
SELECT customers.id, customers.first_name FROM customers
=> [[1, "David"], [2, "Fran"], [3, "Jose"]]
```

Expand All @@ -2049,7 +2049,7 @@ Customer.select(:id).map { |c| c.id }
# or
Customer.select(:id).map(&:id)
# or
Customer.select(:id, :name).map { |c| [c.id, c.first_name] }
Customer.select(:id, :first_name).map { |c| [c.id, c.first_name] }
```

with:
Expand Down Expand Up @@ -2154,7 +2154,7 @@ one of those records exists.
```ruby
Customer.exists?(id: [1,2,3])
# or
Customer.exists?(name: ['Jane', 'Sergei'])
Customer.exists?(first_name: ['Jane', 'Sergei'])
```

It's even possible to use `exists?` without any arguments on a model or a relation.
Expand Down

0 comments on commit f73d9c2

Please sign in to comment.