similar to: Storing BigDecimal in the db

Displaying 20 results from an estimated 3000 matches similar to: "Storing BigDecimal in the db"

2006 Apr 27
5
ColumnComments Plugin
Here?s a small plugin that may be useful for documenting your database. Based on Dave Thomas?s AnnotateModels plugin, this plugin goes one step further and allows you to store comments on each column in the database (MySQL only). Full write-up at: http://blog.inquirylabs.com/2006/04/27/ columncomments-rails-plugin Subversion at: svn://syncid.textdriven.com/svn/opensource/
2006 Mar 31
6
BigDecimal + Float => Float?
I was just playing around in irb and noticed that while BigDecimal + Integer => BigDecimal, BigDecimal + Float => Float. Is there any reason for this? It seems inconsistent and means you have to check the class of any number you add to a BigDecimal, which looks very un-Ruby-like to me. Ashley
2008 Nov 07
15
any tricks re using " eql(5.5)", but where 5.5 is a decimal not float?
-- Sent from my mobile device
2006 Apr 01
7
BigDecimal column type?
I was hoping 1.1 would provide a way to map SQL "decimal" column types to BigDecimal values, since BigDecimal is part of the Ruby standard api as of 1.8. But I don''t see any support for that in the migration documentation, and when I try to let Active Record do the mapping for me, it seems to coerce the column into a Float (as the AwdwR book says). Is it really there in
2006 Jul 09
6
Float -> BigDecimal
So, I''m personally cool with this change (patch from #5454, applied in [4596]), and I''ll make it work for Oracle tomorrow. But just wondering if folks considered the performance impact of the change? From a simple test it seems that BigDecimal math is about twice as slow as using Floats.
2006 Apr 09
16
Mapping to BigDecimals instead of Floats
Hi everyone, I''m new to Rails and Ruby, and have been working my way through the Pickaxe and Agile Rails books for the last week or so. With a background in payroll apps I found that the default ActiveRecord mapping of decimal columns to float variables really bothered me! Financial calcs need high levels of accuracy and floats just don''t give you that. I know there are a bunch
2006 Aug 18
2
Including CSS from a stylesheet file in a an e-mail
How can I include the contents of the file /public/stylesheets/print.css in an RHTML page for ActionMailer? Because there is no controller or session, none of the usual tricks work. Do you have to use basic file IO or there some convenience method I haven''t seen? Thanks Ashley -- "If you do it the stupid way, you will have to do it again" - Gregory Chudnovsky
2006 Jul 27
3
Subversion library for RoR
Hi everybody, Is there a gem or something for working directly with Subversion from a RoR app? Thanks, Tiffani A.B. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060727/26846e72/attachment-0001.html
2012 Mar 28
4
Hash iteration order in a template not consistent
Hi, I did some basic googling, but didn''t find an answer yet. I am sorry if this is a FAQ. In a manifest for creating an Apache config file, I define a hash like this: $aliases = { ''/foo/'' => ''/home/foo/www/'', ''/bar/'' => ''/home/bar/www/'', ''/baz/'' =>
2008 Aug 01
2
BigDecimal to letters
Is there a method that converts BigDecimal 1520.0 to "one thousand five hundred and twenty"? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2009 Feb 03
4
Ruby EE: Problem with BigDecimal
I have a strange problem with my setup of Passenger and Ruby Enterprise Edition. Sometimes the loading of BigDecimals from the database and session fails (silently) and the variable containing the BigDecimal is just empty. I cannot pinpoint where/when/how it happens, and it IS only periodic. I am using the newest versions of both Passenger and REE - I have even tried to run with latest commit
2005 Dec 21
2
ActiveRecord Error with << in Collection
Hi I get a following error: ActiveRecord::AssociationTypeMismatch in Cmdb#create ConfigurationItemAttributeValue expected, got Array RAILS_ROOT: ./script/../config/.. Application Trace | Framework Trace | Full Trace c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/associations/association_collection.rb:128:in `raise_on_type_mismatch''
2008 Jan 19
1
Decimals are being converted to Bigdecimals!!!!!
Hi all, I''m working on a financial app, and have set up some columns in my tables as decimals with precision => 8 and scale => 2. My migration looks like: change_column :lineitems, :price, :decimal, :precision => 8, :scale => 2 change_column :payments, :amount, :decimal, :precision => 8, :scale => 2 I''ve run the migration and restarted the server. I
2006 Apr 02
5
PostgreSQL and unit tests
After upgrading to 1.1, I can''t run any unit tests. Apparently when I run rake test_units, it uses a migration to set up the database. Unfortunately when it runs the migration, it''s adding not null constraints to every field, even though I haven''t got that set up. I''m using the ruby-postgres (0.7.1.2005.12.21) adapter with PostgreSQL 8.1.0. I''m
2006 Jul 30
34
ruby suitable for financial apps?
hi there, I am about to embark on a mission critical financial web application, and was wondering weather ruby on rails is the best fit for this type of project. More specifically I am worried about floating point errors. Would it be more appropriate to use a more statically typed framework (.NET)? thankyou. -- Posted via http://www.ruby-forum.com/.
2011 Jan 20
4
Comment.all returns array of what?
I have a bad feeling asking this but I did not manage to find an answer myself :/ @comments = Comment.all @comments is an array. I can for example access comment.created_at directly, or I could do: <% @comments.each do |comment| %> <%= debug comment["created_at"] %> <% end %> I expected comment to be a hash, but comment.keys or comment.values fail, as well as an
2006 Apr 16
3
variable variables?
Hi everyone, Does Ruby support variable variables like PHP (http://www.php.net/manual/en/language.variables.variable.php)? Or do I have to use eval, like some_hash.each_pair{|key, pair| eval "#{key} = #{value}" } Or is there some other way? I''m actually trying to figure this out in order to use ez_where to create its conditions from a hash, so if this isn''t even
2007 Jan 19
3
Something cool I learned about rspec today
I found an awesome feature today. When you''re setting expectations, you can actually pattern match the parameters to methods. Here''s my discussion and example: http://evang.eli.st/blog/2007/1/19/parameter-matching-in-rspec Pat
2006 Jul 04
8
inherits_from: Multiple table inheritance
Hey guys, I just implemented very simple and primitive class table inheritance in ActiveRecord. The goal is for this to become mature enough to become a true feature in Rails. Check it out here: http://guest@blog.raylucke.com/svn/inherits_from Here?s how it looks in action: create_table "books", :force => true do |t| t.column "product_id", :integer t.column
2007 Sep 03
20
Reason for _spec.rb convention
Hi Easy one - I just wondered why all spec files for rspec_on_rails end "_spec.rb" instead of just ".rb"? They are all inside the spec folder so surely the fact they are specs is implicit? Ashley