Commit ff9d9ded by Robert Wahler

add boolean to col_types that don't show limit(##)

parent e931f734
...@@ -18,6 +18,10 @@ module AnnotateModels ...@@ -18,6 +18,10 @@ module AnnotateModels
SPEC_FACTORIES_DIR = File.join("spec", "factories") SPEC_FACTORIES_DIR = File.join("spec", "factories")
TEST_FACTORIES_DIR = File.join("test", "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 def model_dir
@model_dir || "app/models" @model_dir || "app/models"
end end
...@@ -59,7 +63,9 @@ module AnnotateModels ...@@ -59,7 +63,9 @@ module AnnotateModels
if col_type == "decimal" if col_type == "decimal"
col_type << "(#{col.precision}, #{col.scale})" col_type << "(#{col.precision}, #{col.scale})"
else 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 end
# Check out if we got a geometric column # Check out if we got a geometric column
......
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