AR create_with

I knew there was AR’s

find_or_create_by

  method but I didn’t know it had a very useful companion

create_with

 .

@something ||= SomeModel.create_with(some: "stuff").find_or_create_by(foo: "bar")

This will either find a record 

SomeModel.where(foo: "bar")

  or create it with

SomeModel.create(foo: "bar", some: "stuff")

 . Very useful.

Classic Programmer Paintings

This is a great idea. ?

https://www.tumblr.com/classicprogrammerpaintings/142603266504/engineering-manager-handing-out-tasks-to-interns

https://www.tumblr.com/classicprogrammerpaintings/142602959384/sysadmin-grants-sudo-privileges-to-developer-on

https://www.tumblr.com/classicprogrammerpaintings/142586036029/junior-programmer-learns-git-rebase

https://www.tumblr.com/classicprogrammerpaintings/142344840164/developer-looking-at-production-logs-after-a

https://www.tumblr.com/classicprogrammerpaintings/131118350394/army-of-contractors-migrating-to-microservices