mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
![]() In Rails 4, the following construct: has_many :children, conditions: { adopted: true } changes to: has_many :children, lambda { where(adopted: true) } As a result, the way we check the conditions attached to a has_many changes too: instead of accessing `reflection.options`, we have to use `reflection.scope` -- this which refers to the lambda above, so we have to evaluate it and then grab the `where` from the Relation that the lambda returns. |
||
---|---|---|
.. | ||
shoulda | ||
shoulda-matchers.rb |