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:
@@ -130,10 +130,6 @@ class SavedSearch < ApplicationRecord
|
||||
end
|
||||
|
||||
def disable_labels=(value)
|
||||
CurrentUser.update(disable_categorized_saved_searches: true) if value == "1"
|
||||
end
|
||||
|
||||
def disable_labels=(value)
|
||||
CurrentUser.update(disable_categorized_saved_searches: true) if value == "1"
|
||||
CurrentUser.update(disable_categorized_saved_searches: true) if value.to_s.truthy?
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user