You’re not receiving notifications from this thread.
Wrapping Business Logic with Plain Old Ruby Objects - GoRails
Awesome video. I didn't know about the classify method, I'd been leaning on camelize or more manual conversions if it didn't deal with pluralization gracefully. Which is silly, because they're all right here: http://api.rubyonrails.org/...
Maybe worth noting these are provided by Rails/not in regular Ruby? Who knows.
Ideas for future episodes: are there any parts of Rails that you've traditionally found useful to pull out into PORO's? (I'm mainly thinking of ActiveModel, but really anything.) Sort of a generic question: what makes blocks useful? When would you want to use a block with .call here instead of regular arguments? Lastly, where might an ActiveRecord::Attribute be used for cases like this?
Chris, another great one! You had 3 tests at the beginning for the 3 fee types. With having the code moved to the new classes would you write new tests or you think it's enough to have those 3 tests?
Great episode! Thanks.
I think that in the delegate statement shown (at around 19:50), the suffix 'to: customer' is missing.
Why do we initialize the customer in the base class when its already initialized after a customer object/instance is created in the controller?