vishal-gh / TodoApp

0 stars 1 forks source link

Condense code #20

Open cpiazza opened 3 years ago

cpiazza commented 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.

https://github.com/vishal-gh/TodoApp/blob/da395eb5f57e2bf966c7fe618bc7f8f2a99a62ec/app/models/todo_item.rb#L14

vishal-gh commented 3 years ago

Thanks. Updated the code.