Joined August 2013
·

Matt Campbell

Flatiron
·
NYC
·
·

Have you tried simply:

u = User.includes({ events: :attendances }).find(1)

?

Posted to lambdas in ruby case (switch) over 1 year ago

So the point is you don't need lambda.call because the === operator (which is what gets called by the case statement under the hood) invokes that on the lambda by default?

Since this line is assignment and not equality comparison, won't it always return :truncation?

DatabaseCleaner.strategy = example.metadata[:js] ? :truncation : :transaction
Achievements
94 Karma
4,999 Total ProTip Views