Skip to content

Commit

Permalink
Remove integer column limit calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
haines committed Dec 29, 2011
1 parent 3ec764a commit 64fe28c
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lib/formtastic/inputs/base/validations.rb
Expand Up @@ -183,14 +183,7 @@ def autofocus?
end

def column_limit
if column? && column.respond_to?(:limit)
case column.type
when :integer
(2 ** (column.limit * 8)).to_s.length + 1
else
column.limit
end
end
column.limit if column? && column.respond_to?(:limit)
end

def limit
Expand Down

3 comments on commit 64fe28c

@jnimety
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed?

@justinfrench
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@haines can you join in here?

@jnimety
Copy link
Contributor

@jnimety jnimety commented on 64fe28c Feb 2, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT limit is not applied to Numerics. I think this is a better solution, providing max/min is much more accurate.

Please sign in to comment.