Re: [Rails-core] Adding scopes breaks migrations (Rails 3 beta 4)

2010-07-02 Thread Paul Campbell
> ruby-1.9.2-head > Tester.instance_eval do > ruby-1.9.2-head >     public > ruby-1.9.2-head ?>  def blah > ruby-1.9.2-head ?>    puts "blah" > ruby-1.9.2-head ?>    end > ruby-1.9.2-head ?>  end > Hey, I'm not a keyword, I'm a class method! >  => nil > > Try renaming your scope and see if the issu

Re: [Rails-core] Adding scopes breaks migrations (Rails 3 beta 4)

2010-07-02 Thread Ernie Miller
On Jul 2, 2010, at 9:11 AM, Paul Campbell wrote: > >> defining an attribute based on a Ruby keyword (private). > > I'm pretty sure this isn't the case, since there's no "private" method > name. Interestingly, it's very difficult to come up for a name in this > that isn't a potential collision.

Re: [Rails-core] Adding scopes breaks migrations (Rails 3 beta 4)

2010-07-02 Thread Ernie Miller
On Jul 2, 2010, at 9:11 AM, Paul Campbell wrote: > >> defining an attribute based on a Ruby keyword (private). > > I'm pretty sure this isn't the case, since there's no "private" method > name. Interestingly, it's very difficult to come up for a name in this > that isn't a potential collision. >

Re: [Rails-core] Adding scopes breaks migrations (Rails 3 beta 4)

2010-07-02 Thread Ernie Miller
Pratik, seems like you're right. A quick glance at the scoped method looks like it should be deferring any attempt to actually call a condition until the scope is used, not when it's defined. From Paul's trace, it looks like he is running into an issue caused by the devise_for stuff in his route

Re: [Rails-core] Adding scopes breaks migrations (Rails 3 beta 4)

2010-07-02 Thread Paul Campbell
Ernie, Pratik, On Fri, Jul 2, 2010 at 2:03 PM, Ernie Miller wrote: > Pratik, seems like you're right. A quick glance at the scoped method looks > like it should be deferring any attempt to actually call a condition until > the scope is used, not when it's defined. From Paul's trace, it looks like

Re: [Rails-core] Adding scopes breaks migrations (Rails 3 beta 4)

2010-07-02 Thread Rob Biedenharn
On Jul 2, 2010, at 8:40 AM, Paul Campbell wrote: On Fri, Jul 2, 2010 at 12:58 PM, Pratik wrote: I swear I had fixed this. Will have another look. It may be fixed in edge, I'm working off beta4. Will switch to edge and double check. —P If you are using 1.9.2, you may also want to check wh

Re: [Rails-core] Adding scopes breaks migrations (Rails 3 beta 4)

2010-07-02 Thread Paul Campbell
On Fri, Jul 2, 2010 at 12:58 PM, Pratik wrote: > I swear I had fixed this. Will have another look. It may be fixed in edge, I'm working off beta4. Will switch to edge and double check. —P > > On Fri, Jul 2, 2010 at 12:54 PM, Ernie Miller wrote: >> I think the article entitled "Named Scopes Are

Re: [Rails-core] Adding scopes breaks migrations (Rails 3 beta 4)

2010-07-02 Thread Pratik
I swear I had fixed this. Will have another look. On Fri, Jul 2, 2010 at 12:54 PM, Ernie Miller wrote: > I think the article entitled "Named Scopes Are Dead" had some good > insights along those lines. > > http://www.railway.at/2010/03/09/named-scopes-are-dead/ > > In the Rails 3 app I've been wo

Re: [Rails-core] Adding scopes breaks migrations (Rails 3 beta 4)

2010-07-02 Thread Ernie Miller
I think the article entitled "Named Scopes Are Dead" had some good insights along those lines. http://www.railway.at/2010/03/09/named-scopes-are-dead/ In the Rails 3 app I've been working on, my scopes are just class methods like shown there. On Jul 2, 2010, at 6:57 AM, Paul Campbell wrote: >

[Rails-core] Adding scopes breaks migrations (Rails 3 beta 4)

2010-07-02 Thread Paul Campbell
I came across an interesting issue this morning using Rails 3 beta 4. in my user.rb I have a scope: scope :public, where(:private => false) This was absolutely fine when I added the scope, since the "private" field was in the database. I wanted to modify the migration, so I rolled back the data