Open cpiazza opened 3 years ago
Pretty sure you can do this in one line with tags.create!(tagname: x). Note the ! which will raise an error if the create fails.
tags.create!(tagname: x)
!
https://github.com/vishal-gh/TodoApp/blob/da395eb5f57e2bf966c7fe618bc7f8f2a99a62ec/app/models/todo_item.rb#L14
Thanks. Updated the code.
Pretty sure you can do this in one line with
tags.create!(tagname: x)
. Note the!
which will raise an error if the create fails.https://github.com/vishal-gh/TodoApp/blob/da395eb5f57e2bf966c7fe618bc7f8f2a99a62ec/app/models/todo_item.rb#L14