Skip to content

Commit 1c5deb0

Browse files
nard-techdrwl
authored andcommitted
Refactor AnnotateModels::Helpers (#723)
I refactored two methods in AnnotateModels::Helpers for readability.
1 parent 9a8db1b commit 1c5deb0

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/annotate/helpers.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,11 @@ def include_models?
1515
end
1616

1717
def true?(val)
18-
return false if val.blank?
19-
return false unless val =~ Constants::TRUE_RE
20-
21-
true
18+
val.present? && Constants::TRUE_RE.match?(val)
2219
end
2320

2421
def fallback(*args)
25-
args.detect { |arg| !arg.blank? }
22+
args.detect(&:present?)
2623
end
2724

2825
def reset_options(options)

0 commit comments

Comments
 (0)