|
Ran
|
Files
29
|
Run time
1s
|
Badge
README BADGES
|
push
travis-ci
Fix conditionals (#686) The Ruby on Rails guide contains the following example ``` class Computer < ApplicationRecord validates :mouse, presence: true, if: ["market.retail?", :desktop?], unless: Proc.new { |c| c.trackpad.present? } end ``` Arrays and Strings were not supported before. https://github.com/rails/rails/blob/38fe5ae24/activesupport/lib/active_support/callbacks.rb#L429-L458 was used for inspiration. Removes reference to "any object that responds to `#call`" in README, because this is not how ActiveModel behaves. It doesn't check for `#call`, but for class (`Proc`), and if it's an arbitrary object it calls callback scope (which is `validate`). This behavior is not documented in Rails guides.
589 of 592 relevant lines covered (99.49%)
21.48 hits per line
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|