Re: [rspec-users] Of ActiveRecord, arel, and train wrecks

2010-02-22 Thread Pat Maddox
>From a mocking / stubbing perspective, how is this different from Article.all(:conditions => ['published_at <= ?', Time.now], :include => :comments) ? i.e. in both cases wouldn't you do class Article def self.active_published all :conditions => ['published_at <= ?', Time.now], :include =>

Re: [rspec-users] Of ActiveRecord, arel, and train wrecks

2010-02-22 Thread Rick DeNatale
On Mon, Feb 22, 2010 at 6:16 PM, Scott Taylor wrote: > I haven't spent enough time with it yet to know, but I suspect that surface > mocking (what is usually called stubbing in this community) is going to get > harder with the demeter violations. > One of the things that I tend to do, is to no

Re: [rspec-users] Of ActiveRecord, arel, and train wrecks

2010-02-22 Thread Scott Taylor
On Feb 22, 2010, at 6:07 PM, Rick DeNatale wrote: > I thought that it might be worth starting a discussion about the best > approaches to deal with spec'ing what's becoming more and more common > in apps using active record. > > It started with named scopes, now we have arel, and the old find ca

[rspec-users] Of ActiveRecord, arel, and train wrecks

2010-02-22 Thread Rick DeNatale
I thought that it might be worth starting a discussion about the best approaches to deal with spec'ing what's becoming more and more common in apps using active record. It started with named scopes, now we have arel, and the old find calls with parameters are being deprecated. When I watched Ryan