Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
annotate
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
annotate
Commits
1c5deb09
Commit
1c5deb09
authored
Jan 19, 2020
by
Shu Fujita
Committed by
Andrew W. Lee
Jan 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor AnnotateModels::Helpers (#723)
I refactored two methods in AnnotateModels::Helpers for readability.
parent
9a8db1b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
helpers.rb
lib/annotate/helpers.rb
+2
-5
No files found.
lib/annotate/helpers.rb
View file @
1c5deb09
...
@@ -15,14 +15,11 @@ module Annotate
...
@@ -15,14 +15,11 @@ module Annotate
end
end
def
true?
(
val
)
def
true?
(
val
)
return
false
if
val
.
blank?
val
.
present?
&&
Constants
::
TRUE_RE
.
match?
(
val
)
return
false
unless
val
=~
Constants
::
TRUE_RE
true
end
end
def
fallback
(
*
args
)
def
fallback
(
*
args
)
args
.
detect
{
|
arg
|
!
arg
.
blank?
}
args
.
detect
(
&
:present?
)
end
end
def
reset_options
(
options
)
def
reset_options
(
options
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment