TODAY I LEARNED

Rails 5.1 added :default option to belongs_to

From the changelog

image

Now if only someone would add it to has_one relationships. Tim says it's harder because then you're setting attributes on another object.

Tweet

Learned by obie-fernandez on Sep 22, 2017

Discover our latest blog posts
  • #rails
  • view raw
  • permalink
  • 2 likes
previous TIL next TIL
  • Log in
  • ?

    TIL is an open-source project by MagmaLabs that exists to catalogue the sharing & accumulation of knowledge as it happens day-to-day. Posts have a 200-word limit, and posting is open to any MagmaLaber as well as selected friends of MagmaLabs. We hope you enjoy learning along with us.

    • /wearemagmalabs
  • statistics
  • search
  • Twitter