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
ff9d9ded
Commit
ff9d9ded
authored
Jun 01, 2010
by
Robert Wahler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add boolean to col_types that don't show limit(##)
parent
e931f734
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
annotate_models.rb
lib/annotate/annotate_models.rb
+7
-1
No files found.
lib/annotate/annotate_models.rb
View file @
ff9d9ded
...
...
@@ -18,6 +18,10 @@ module AnnotateModels
SPEC_FACTORIES_DIR
=
File
.
join
(
"spec"
,
"factories"
)
TEST_FACTORIES_DIR
=
File
.
join
(
"test"
,
"factories"
)
# Don't show limit (#) on these column types
# Example: show "integer" instead of "integer(4)"
NO_LIMIT_COL_TYPES
=
[
"integer"
,
"boolean"
]
def
model_dir
@model_dir
||
"app/models"
end
...
...
@@ -59,7 +63,9 @@ module AnnotateModels
if
col_type
==
"decimal"
col_type
<<
"(
#{
col
.
precision
}
,
#{
col
.
scale
}
)"
else
col_type
<<
"(
#{
col
.
limit
}
)"
if
(
col
.
limit
&&
col_type
!=
"integer"
)
if
(
col
.
limit
)
col_type
<<
"(
#{
col
.
limit
}
)"
unless
NO_LIMIT_COL_TYPES
.
include?
(
col_type
)
end
end
# Check out if we got a geometric column
...
...
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