[#2179] Simplify id_compatible?

This commit is contained in:
Frederic Merizen 2018-07-31 14:45:50 +02:00
parent b3cb06b7e5
commit a42c4ade4c

View file

@ -31,12 +31,10 @@ class DossierSearchService
end
def self.id_compatible?(number)
begin
ActiveRecord::Type::Integer.new.serialize(number)
true
rescue ActiveModel::RangeError
false
end
ActiveRecord::Type::Integer.new.serialize(number)
true
rescue ActiveModel::RangeError
false
end
def self.dossier_by_full_text_for_gestionnaire(search_terms, gestionnaire)