Skip to content

Commit

Permalink
Refactor AnnotateModels::Helpers (ctran#723)
Browse files Browse the repository at this point in the history
I refactored two methods in AnnotateModels::Helpers for readability.
  • Loading branch information
nard-tech authored and vfonic committed May 8, 2020
1 parent d9eca25 commit 7e5a026
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/annotate/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@ def include_models?
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)
Expand Down

0 comments on commit 7e5a026

Please sign in to comment.