[Rails] How to detect integration tests running ?

2012-06-13 Thread sreid
How can I detect that test:unit integration tests are being run, so I can start/stop some background processes once for the duration of all the integration tests only, but not for unit / functional tests ? -- You received this message because you are subscribed to the Google Groups "Ruby on Ra

[Rails] How to configure postgresql databases on different drives ?

2012-05-21 Thread sreid
Is it possible to configure postgresql so that the development database is on one drive, and the test database is on another drive (an SSD in this case) ? Can this be done with database.yml, or some other method ? I'm using Windows 7. -- You received this message because you are subscribed to th

[Rails] Re: Send mail and embed image

2011-10-18 Thread sreid
Hi, You could send your email "multi-part". For this you normally need 2 templates - html and txt. In the html template, you can include images as with normal html, and if the recipient accepts html format emails, he will see the image (otherwise he gets the txt version). See more here http://edg

[Rails] Re: activerecord model belongs_to and validates_associated duplicate validation

2011-08-25 Thread sreid
Also, is there some reason why validates_associated does not throw an exception on nil ? -- 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@googlegroups.com. To unsubscribe from this grou

[Rails] Re: activerecord model belongs_to and validates_associated duplicate validation

2011-08-25 Thread sreid
And if it is a duplication, are there any differences, and which method is best ? -- 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@googlegroups.com. To unsubscribe from this group, send

[Rails] activerecord model belongs_to and validates_associated duplicate validation

2011-08-25 Thread sreid
In one of my models I have these lines : belongs_to :user, :validate => true ... validates_associated :user When I remove the 2nd one, my tests run noticeably faster. Is the above causing validations to be run twice ? -- You received this message because you are subscribed to the Google Gro

[Rails] Re: Rails 3.1rc6 assets / precompile change

2011-08-18 Thread sreid
Correct url above should be https://github.com/rails/rails/commit/0c57ae102f938b8f3d14d7cc37ab15b87bdaa4f5 -- 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@googlegroups.com. To unsubsc

[Rails] Rails 3.1rc6 assets / precompile change

2011-08-18 Thread sreid
I'm currently using Rails 3.1rc5, and deploy with capistrano. During deploy, I precompile the assets on the server using assets:precompile after deploy:symlink. I noticed that "group :assets" gems in my gemfile were being included in my production application processes (and adding a lot of memory

[Rails] Re: Controller integer param converted to string in 3.1rc5

2011-08-11 Thread sreid
For clarity, I was referring to the "update" object above being changed (it's a hash, created by factory girl gems attributes_for method). I guess at some point there is Rails code which converts this to string params for passing to the controller ? Maybe now in 3.1rc1, this also changes the updat

[Rails] Controller integer param converted to string in 3.1rc5

2011-08-11 Thread sreid
I've just upgraded from Rails 3.0.7 to 3.1rc5, and am getting some functional test failures with an existing app. When I call a controllers create or update action. e.g. : post :create, :modelname => update on return, the only integer param passed in has been changed type from e.g. 30 to "30"

[Rails] Re: Problem upgrading to Rails 3.1 using capistrano.

2011-08-09 Thread sreid
Seems to have been fixed overnight by new bundler version 1.0.17 : see https://github.com/carlhuda/bundler/issues/1342 On Aug 8, 11:24 pm, sreid wrote: > I've upgraded a Rails 3.0 app to Rails 3.1. It's working fine on my > development Windows PC using Webrick / ruby 1.8.7. >

[Rails] Problem upgrading to Rails 3.1 using capistrano.

2011-08-08 Thread sreid
I've upgraded a Rails 3.0 app to Rails 3.1. It's working fine on my development Windows PC using Webrick / ruby 1.8.7. I tried to deploy using Capistrano to a server using Passenger/nginx/ REE, but am getting this error : * executing "cd /home/.../releases/20110808200618 && bundle install --gem

[Rails] Re: Setup database on new clone

2011-07-21 Thread sreid
Thanks for the suggestions. I ended up using the method described here : http://stackoverflow.com/questions/3485059/running-rake-dbmigrate-without-some-initializers -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, s

[Rails] Setup database on new clone

2011-07-20 Thread sreid
I've just cloned my rails app onto another PC, and I'm having a problem getting the database set up. I've tried rake db:migrate, then db:create and also db:reset, but I keep getting an SQLException "no such table". It seems this is due to a line in an initializer which accesses one of my tables.

[Rails] Re: refreshing multiple activerecord objects referring to same database record

2011-07-18 Thread sreid
I just used childs to show it was the plural. Would rails pluralize child to children ? All the attributes match correct in both cases - including parent_id - but not parent. I assume the parent object is not a real attribute, as only parent_id is shown when I do an inspect. -- You received this

[Rails] Re: refreshing multiple activerecord objects referring to same database record

2011-07-18 Thread sreid
My problem occurs when trying to modify a parent record from a child, using an after_create callback in the child is created (they have a has_many / belongs_to association). After some more testing (checking object ids), I can get a test to pass if I use (e.g.) : 1) Child.create(:parent => parent

[Rails] Re: refreshing multiple activerecord objects referring to same database record

2011-07-18 Thread sreid
Is there some way to get a list of the existing instances which refer to the record ? Would upgrading to 3.1 and enabling identity map solve the problem ? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email

[Rails] refreshing multiple activerecord objects referring to same database record

2011-07-17 Thread sreid
I have an issue where I seem (unintentionally) to have more than 1 activerecord object/instance referring to the same database record. How do I ensure that when I update the record, all instances are refreshed with the same data ? It sounds like "identity map" which is being added to activerecord

[Rails] activerecord caching / association problem

2011-06-21 Thread sreid
I've 2 models with a belongs_to / has_many relationship - e.g. Users has_many Orders. The problem I have seems related to activerecord caching (which I'm not 100% clear on). ex1 : user = User.create user.orders.each ... # => (no orders, as expected) user.orders.create user.orders.each ... # =>

[Rails] tests fail after activerecord rename_column

2011-03-22 Thread sreid
I've renamed a column in an activerecord table by migrating. I searched and changed all references from to in source / tests. However, a lot of my tests now fail with errors of the type : SQLException ... table has no column named . I also did a grep and can't find any references to in the pro