🕵️♀️ Task
The find method searches for a row/record by it’s primary key (conventionally named id). The find method requires an argument that will be used to look up the object from the table.
find
id
LevelUp
Selecting all records
Find one record by primary...
Counting records
Find record via index
Find record by position us...
Order records by column va...
Retrieving values from col...
Retrieve all values from a...
Limit number of selected r...
Offset selected records
Filtering records with whe...
Exclude records from result
Calculate minimum value in...
Calculate maximum value in...
Calculate average value in...
Calculate sum of values in...
Find the "many" side of a ...
Find the "one" side of one...
Many-to-many associations ...
0.0% complete
Find the customer with the primary key 10.
customer = Customer.find(10) => #<Customer id: 10, first_name: "Ryan"
Find the store with the primary key 56.
store = Store.find(56) => #<Store id: 56, name: "JC Penny's"