String: add truthy? & falsy? core extensions.
* Add `truthy?` and `falsy?` core extensions to String. * Use `truthy?` and `falsy?` to replace ad-hoc parsing of boolean parameters in various places.
This commit is contained in:
@@ -205,10 +205,6 @@ class BulkUpdateRequest < ApplicationRecord
|
||||
end
|
||||
|
||||
def skip_secondary_validations=(v)
|
||||
if v == "1" or v == true
|
||||
@skip_secondary_validations = true
|
||||
else
|
||||
@skip_secondary_validations = false
|
||||
end
|
||||
@skip_secondary_validations = v.to_s.truthy?
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user