I would also add an index on the status. As you mentioned you often use this value to filter records in the database. So indexing this column would improve speed.
Good to know that you're back Andy, learning a lot from your videos. Looking for your in-depth tutorials on Hotwire as well 😉 Def gonna buy your 'Hello Rails' if/when you'll update it for Rails 7 💪
Not directly, but you can hook up some routes and controllers and respond to update an enum very quickly using a button. Each enum comes with short-hand methods for changing to that specific value. i.e., A Blog post with enums: @post.published! or @post.draft! A Blog post without enums: @post.update(status: "published") There's more than that to them though. Check out the API docs: api.rubyonrails.org/v5.1/classes/ActiveRecord/Enum.html
your explanation on enum was awesome .
Hi Andy, thanks for the help with reminding the details with enums today.
I would also add an index on the status. As you mentioned you often use this value to filter records in the database. So indexing this column would improve speed.
Good call 👌
Good to know that you're back Andy, learning a lot from your videos. Looking for your in-depth tutorials on Hotwire as well 😉
Def gonna buy your 'Hello Rails' if/when you'll update it for Rails 7 💪
Thanks for the kind words. The course is a big one to update but I'm hoping to find the time soon!
can we use enum with buttons to change the value of enums?
Not directly, but you can hook up some routes and controllers and respond to update an enum very quickly using a button.
Each enum comes with short-hand methods for changing to that specific value.
i.e., A Blog post with enums:
@post.published! or @post.draft!
A Blog post without enums:
@post.update(status: "published")
There's more than that to them though. Check out the API docs: api.rubyonrails.org/v5.1/classes/ActiveRecord/Enum.html
@@Webcrunch thanks alot sir❤️❤️
Plz can you tell me which plugins and themes are you using for your terminal....BTW big fan of yours
Just published a detailed guide here th-cam.com/video/pZaID7YroXg/w-d-xo.html
Thanks alot
Are u back Andy ? Long time no videos from you
I am! Took a much needed break but excited to get back to it.