Skip to content
This repository has been archived by the owner on Jan 2, 2020. It is now read-only.

Rails 3.1 , mongoid 2.3.1, float-field, -> wrong argument type nil (expected Fixnum) #14

Open
dryaf opened this issue Oct 11, 2011 · 2 comments

Comments

@dryaf
Copy link

dryaf commented Oct 11, 2011

class Post
  include Mongoid::Document
  include Mongoid::Timestamps

  field :name, :type => String
  field :age, :type => Integer
  field :cool, :type => Float

end

results in

Showing /home/sallas/Aptana Studio 3 Workspace/viterma/app/views/posts/show.html.haml where line #13 raised:

wrong argument type nil (expected Fixnum)
Extracted source (around line #13):

10:       =p.attributes  do
11:         = p.attribute  :name
12:         = p.attribute  :age
13:         = p.attribute  :cool
14:     

Framework-Trace:
actionpack (3.1.0) lib/action_view/helpers/number_helper.rb:281:in round' actionpack (3.1.0) lib/action_view/helpers/number_helper.rb:281:innumber_with_precision'
attrtastic (0.4.2) lib/attrtastic/semantic_attributes_builder.rb:390:in format_attribute_value' attrtastic (0.4.2) lib/attrtastic/semantic_attributes_builder.rb:314:inattribute'
haml (3.1.3) lib/haml/helpers/action_view_mods.rb:93:in block in capture_with_haml' haml (3.1.3) lib/haml/helpers.rb:345:incall'
haml (3.1.3) lib/haml/helpers.rb:345:in block in capture_haml' haml (3.1.3) lib/haml/helpers.rb:569:inwith_haml_buffer'
haml (3.1.3) lib/haml/helpers.rb:341:in capture_haml' haml (3.1.3) lib/haml/helpers/xss_mods.rb:61:incapture_haml_with_haml_xss'
haml (3.1.3) lib/haml/helpers/action_view_mods.rb:93:in capture_with_haml' attrtastic (0.4.2) lib/attrtastic/semantic_attributes_builder.rb:355:inattributes_for'
attrtastic (0.4.2) lib/attrtastic/semantic_attributes_builder.rb:196:in attributes' haml (3.1.3) lib/haml/helpers/action_view_mods.rb:93:inblock in capture_with_haml'
haml (3.1.3) lib/haml/helpers.rb:345:in call' haml (3.1.3) lib/haml/helpers.rb:345:inblock in capture_haml'
haml (3.1.3) lib/haml/helpers.rb:569:in with_haml_buffer' haml (3.1.3) lib/haml/helpers.rb:341:incapture_haml'
haml (3.1.3) lib/haml/helpers/xss_mods.rb:61:in capture_haml_with_haml_xss' haml (3.1.3) lib/haml/helpers/action_view_mods.rb:93:incapture_with_haml'
attrtastic (0.4.2) lib/attrtastic/semantic_attributes_helper.rb:51:in `semantic_attributes_for'

@dryaf
Copy link
Author

dryaf commented Oct 11, 2011

This is not an attrtastic-Bug. It is a rails bug

probably its good to leave this bug open tills it is fixed so people can find a solution quickly

fix is here:
rails/rails#2802

@dryaf dryaf closed this as completed Oct 11, 2011
@dryaf dryaf reopened this Oct 11, 2011
@MBO
Copy link
Owner

MBO commented Oct 13, 2011

Ok, no problem leaving this as a way to find correct solution for problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants