Settings

Theme

Ask HN: Who and how uses ensuring_owner_was on ActiveRecord

1 points by ceritium a year ago · 2 comments · 1 min read


Reading the docs for the `has_one` relation of ActiveRecord I found the option `ensuring_owner_was`

I didn't understand how to use it, so I looked for it on Github, but it doesn't seem very popular...

https://github.com/search?q=ensuring_owner_was+language%3ARuby+path%3Aapp%2Fmodels&type=code

sarcasmatwork a year ago

Look at actual ruby docs, not github.

https://api.rubyonrails.org/classes/ActiveRecord/Association...

  • ceritiumOP a year ago

    Yes, I read the "Rails" docs—the same that you linked—but I wanted to see how other projects use it. My surprise was that only a public project on Github uses it.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection