Ruby on Rails Wednesday, February 12, 2014

On Tuesday, February 11, 2014 4:46:41 PM UTC, Ruby-Forum.com User wrote:
My team is currently upgrading a rails app from 3.2.3 to 4.0 with JRuby
1.7.10 backed by Oracle.  Under Rails 3.2.3 everything is  nice and
happy...

We have a model called JobMetadata and every numeric column is an
integer (although Oracle does store them as Number(38).  The database is
unchanged from 3.2.3 to 4.0.

Suppose I have an instance (of JobMetadata ) called jmd, and I reference
jmd.max_execution_time.  jmd.max_execution_time.class is a FixNum ( in
4.0 -- yay).

If I pull it out in erb (via form_for) it always pulls out a string
representation of a float like "60.0" in 4.0 (but "60" in 3.2.3).
For example:

<%= form_for(@job_metadata, :url => { :action => "update" }) do |f| %>
<%= f.text_field :max_execution_minutes, :size=>10%>

Would yield "60" in the text field in 3.2.3 but "60.0" in 4.0.
We "fixed" this issue via:

What does JobMetadata.columns think that the column type is?

Fred

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/eaa6c5ce-1eea-49ad-949b-67957f71d014%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment