7
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin
Jonathan del Strother

@nateberkopec (I had to sneak a look at Xitter to see what you were talking about)

I wonder if you could override view_assigns in your controller and just call `strict_loading` on any ActiveRecord objects to enforce this

1
1y
Dave Copeland :ruby:

@nateberkopec never having to hear from DHH or 37Signals employees ever again.

0
1y
Jason Garber

@nateberkopec Yeet DHH into the sun.

0
1y
Ryan Bigg

@nateberkopec it’d be a coin flip between implicit instance variable passing to views, and removing Active Record and replacing it with something repository pattern based instead.

I read the replies and also agree with the DHH yeeting.

0
1y
Irving Reid

@nateberkopec (pretending you intended to ask) unless I specifically ask for a detached copy, there is only one shared in-memory instance of each model. Subsequent fetches get references to the existing (possibly dirty) instance, unless you explicitly reload with db contents

1
1y
Bradley Schaefer

@nateberkopec I don’t know why, but controllers bother me a lot. Redesign them to be reasonably instantiatable, testable, get rid of hooks, no controller ivar sharing with views, really think about improvements to a lot of patterns that have emerged

0
1y
Damax

@nateberkopec having tests and views next to the controller

0
1y
Replies