Commit 1c5deb09 by Shu Fujita Committed by Andrew W. Lee

Refactor AnnotateModels::Helpers (#723)

I refactored two methods in AnnotateModels::Helpers for readability.
parent 9a8db1b7
......@@ -15,14 +15,11 @@ module Annotate
end
def true?(val)
return false if val.blank?
return false unless val =~ Constants::TRUE_RE
true
val.present? && Constants::TRUE_RE.match?(val)
end
def fallback(*args)
args.detect { |arg| !arg.blank? }
args.detect(&:present?)
end
def reset_options(options)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment