Manually Testing Your Models
suggest changeYou can exercise Active Record models from the app directory with rails console.
If the users table has name and email string columns:
User.create name: "John", email: "john@example.com"
To load that record:
User.find_by email: "john@example.com"
Or, if it is the only row, load the first record:
User.first
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents