Displaying 20 results from an estimated 500 matches similar to: "Testing equality"
2007 Oct 17
16
rspec causing validates_presence_of to validate twice?
I had posted this on the regular Rails list, but upon trying this in
script/console, it seems like the behavior only exists when running rspec.
I''m getting some weird behavior in one of my models. I have a model
defined something like this
class User < ActiveRecord::Base
attr_accessor :password
validates_presence_of :password
end
If I validate the model without specifying a
2010 Jul 28
3
Rails 3.0.0.rc // rails locales prevent app boot
Hi all,
I got the following error message when booting up my app (which works
fine with Rails 3.0.0.beta4) in Rails 3.0.0.rc;
activesupport-3.0.0.rc/lib/active_support/file_update_checker.rb:27:in
`stat'': can''t convert Array into String (TypeError)
When I put some debug code on that line I see the follwing array being
passed;
2008 May 29
9
Coloured output in rspec 1.1.4
Hello.
I have lost the coloured output in autotest after updating to rspec
v1.1.4
I was already using the edge version and was ok then, before the last
update.
Anyone knows something about this?
Thank you.
--
Posted via http://www.ruby-forum.com/.
2015 Mar 09
5
Notes on building a gcc toolchain for Rtools (but not multilib)
Hi,
[This is a follow-up to the "New version of Rtools for Windows" thread
in January, but I just subscribed and don't know how to reply to an
old thread -- my apologies.]
I was able to use the nuwen distro to build a gcc 4.9.2 toolchain and
use it to build the latest R-patched with it.
Below are some notes about what I did; I hope they will be useful for
keeping Rtools
2009 Mar 02
2
Changes in specs for routes in rspec 1.1.99.x
Trying the next release of rspec, I have had to make changes in the
existing specs for routing.
I have written an script with sed that makes this automatically (two
files)
spec/upgrade.sed
================
/route_for/s/id => 1/id => "1"/g
/route_for.*create/s/== \(["''].*["'']\)/== {:path => \1, :method =>
:post}/
/route_for.*update/s/==
2010 Dec 23
36
Weird issue with converting floats to integer
Any idea why this calculates the integer the way it does?
irb> ("291.15".to_f * 100.0).to_i
=> 29114
Thanks,
Tom
--
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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
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 Feb 09
1
acts_as_authenticated plugin
Hello,
I have just installed the plugin.
Can somebody tell me how create some users in the ''users'' table.
Is there a doc explaining how to use the plugin for a newbie?
Thanks
Juanma
--
Posted via http://www.ruby-forum.com/.
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.
2008 Jun 04
8
Why has the --color gone from my life?
Hi all,
Running on OSX 10.5.3, Latest Rspec trunk, Rspec rails trunk, latest
autotest gem and rails 2.1
I''ve lost my colour output in autotest.
rake spec gives colour output, but autotest gives me black and white.
It was working a little bit before, I think I upgraded to the latest
versions of everything to get all the textmate snippets talking and being
friendly to one another again
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
2008 Jun 11
1
Resourse route in namespace with prefix error
Ok so I have this route
map.namespace :trades do |trades|
trades.resources :buys, :path_prefix => ''/trades/:contract_id''
end
I want the contract_id variable to filter a list of buys
then I try to open this route http://localhost:3000/trades/1/buys
I get a strange error:
ActionController::RoutingError in Trades/buys#index
Showing trades/buys/index.html.erb where line
2007 Nov 13
4
question about activerecord test_numeric_fields in base_test.rb
There''s a test for activerecord called test_numeric_fields in
base_test.rb. here''s the test
def test_numeric_fields
m = NumericData.new(
:bank_balance => 1586.43,
:big_bank_balance => BigDecimal("1000234000567.95"),
:world_population => 6000000000,
:my_house_population => 3
)
assert m.save
m1 =
2007 Aug 30
3
Rails - depot application
I''m doing the depot example in the Agle Web development book. I''m
getting this error:
"undefined method `product'' for #<BigDecimal:331ce70,''0.21E1'',8(8)> "
"Extracted source (around line #9):
8: for item in @items
9: product = item.product
10: -%>
11: <tr>
12: <td><%= item.product%></td>"
2010 Jun 25
5
Error installing gems for Rails 3.0.0.beta4 on MacOSx
I tried to install Rails 3 Beta in my snow.leopard machine using the
command below: (w/ sudo if it requires)
gem install tzinfo builder memcache-client rack rack-test rack-mount
erubis mail text-format thor bundler i18n
unfortunately after 12 gems installed i got an error regarding
builder-2.1.2
12 gems installed
Installing ri documentation for tzinfo-0.3.22...
Installing ri documentation for
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 Jun 12
6
Storing "money" in databases
Hiall,
I''m wondering what''s common practice when dealing with money values
stored in databases. I like the idea of storing all the values as
integers, i.e. all the values in eurocents not euros. Then I need to
multiply all values the users enter by 100 before storing them in the
database. Now the question is, what''s the most efficient and dryest
way to do this?
2007 Oct 19
14
Agile Web Development Book, need a bit of help
I''m working my way through the book Agile Web Development with Rails,
and I am in the section where the book has me creating a display_cart
method and the associated view. When I copied the code from the book
into the view, it threw this error. If anyone could give me some hints
where I should be looking I''d appreciate it.
NoMethodError in Store#display_cart
Showing
2009 Oct 07
1
output validations errors form causing type error?
Hi,
I was wondering if it is possible to output validation errors in a
nested form? I suppose this should be possible, but I am experiencing
an error message that I can''t track down.
The error I get is the following :
TypeError in Store/orders#create
Showing app/views/store/orders/new.html.erb where line #45 raised:
can''t convert Array into String
This is ocurring in the