bundle exec rails console
# or shorthand
bundle exec rails c
Task.column_names # ["id", "title", "created_at", "updated_at"]
Task.count # total rows in tasks table
Task.create(title: "First Task")
exit
reload! # Reload app code
my_task.reload # Reload object from DB
Works only on saved records.
Task.find(1)
_ # returns last evaluated value