Skip to content

Commit

Permalink
bug fix: default_string_options returned byte size for integers
Browse files Browse the repository at this point in the history
Original causes issues with integer editing, :maxlength is set to the byte size as
stored in the DB, i.e. MySQL = 4.  Suggest using html_options rather than setting any defaults
  • Loading branch information
robertwahler committed Jun 9, 2009
1 parent 437c4d1 commit 435f52e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/formtastic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,10 @@ def find_reflection(method)
# the database.
#
def default_string_options(method) #:nodoc:
# short-circuit, see comment below
return {}
# TODO: Code below causes issues with integer editing, :maxlength is set to the byte size as
# stored in the DB, i.e. MySQL = 4. Suggest using html_options rather than setting any defaults
column = @object.column_for_attribute(method) if @object.respond_to?(:column_for_attribute)

if column.nil? || column.limit.nil?
Expand Down

0 comments on commit 435f52e

Please sign in to comment.