[Rails-core] Generic Missing Template Exception Message

2007-06-18 Thread dasil003
Okay, with all my whining in the last thread, I thought I'd take some time to fix a real problem. I'm not sure if anyone else has noticed, but the Missing Template messages have become generic in edge rails since view_paths were introduced, because they are relying on ActionView::Base.full_templa

[Rails-core] Re: with_scope should not be protected.

2007-06-18 Thread Gabe da Silveira
Brilliant. Okay, my grievances are really starting to melt away now. On 6/19/07, Chris Wanstrath <[EMAIL PROTECTED]> wrote: > > First thing: > > class << ActiveRecord::Base > public :with_scope > end > > Second thing: > > > * The first thing is that ideally this would be modelled by User > > h

[Rails-core] Re: with_scope should not be protected.

2007-06-18 Thread Chris Wanstrath
First thing: class << ActiveRecord::Base public :with_scope end Second thing: > * The first thing is that ideally this would be modelled by User > has_many :accessible_properties, but that is not possible because > accessible_properties does not have static conditions (they depend on > the in

[Rails-core] Re: with_scope should not be protected.

2007-06-18 Thread Gabe da Silveira
I see what you're saying, but I think it's a little presumptuous to dictate this architecture just to satisfy an abstract concept of how things should be structured. David often says how he hates contrived examples, and removing with_scope access to other models feels like it's based on certain a

[Rails-core] Re: with_scope should not be protected.

2007-06-18 Thread Tim Lucas
On 19/06/2007, at 11:47 AM, dasil003 wrote: > * I know I could work around this by refactoring the functionality > into Property and passing the user as a parameter, but that makes my > code both more complicated and more opaque. The User should know what > properties it can access. A Property

[Rails-core] Re: with_scope should not be protected.

2007-06-18 Thread Rick Olson
> class User < ActiveRecord::Base > def accessible_property_find(*args) > Property.with_scope(:find => accessible_property_options) do > Property.find(*args) > end > end > end NFI what accessible_property_options is, but I'm guessing it has to do with the current user? This is

[Rails-core] Re: with_scope should not be protected.

2007-06-18 Thread Obie Fernandez
> Oh ... now I see buggy GMail keeps me out of sync, and that you're > discussing association extensions and model-to-model stuff. My bad, sorry - > I will show myself out. Don't feel bad.. GMail got me too just now. :( --~--~-~--~~~---~--~~ You received this mess

[Rails-core] Re: with_scope should not be protected.

2007-06-18 Thread Gabe da Silveira
Come on now, that's a totally bogus analogy. The separation between M and VC is huge. You gain so incredibly much from having your models independent that there's absolutely no reason to support that. The whole with_scope thing is much more nuanced. Please review my use case and tell me how it

[Rails-core] Re: with_scope should not be protected.

2007-06-18 Thread Mislav Marohnić
On 6/19/07, Mislav Marohnić <[EMAIL PROTECTED]> wrote: > > > There were also people that wanted to be able to access sessions and > controller params in their models. Naturally, the core team wouldn't allow > that. Imagine what would happen if they did... Oh ... now I see buggy GMail keeps me out

[Rails-core] Re: with_scope should not be protected.

2007-06-18 Thread Mislav Marohnić
On 6/19/07, dasil003 <[EMAIL PROTECTED]> wrote: > > > Since when has Rails been about protecting programmers from themselves? There were many fights about with_scope back when it was public. Rails is opinionated, and it is the opinion of the core team that it should become protected to ensure cle

[Rails-core] Re: with_scope should not be protected.

2007-06-18 Thread Obie Fernandez
+1 to rolling back this change until there's a way to make with_scope available to association extensions. The useful (and AFAIK popular) technique for creating typed join models detailed at http://blog.hasmanythrough.com/2006/8/19/magic-join-model-creation is broken by making with_scope protecte

[Rails-core] Re: with_scope should not be protected.

2007-06-18 Thread Jamis Buck
You can always access it via send(): Foo.send(:with_scope, ...) do # ... end All that making it protected does is make sure people realize they are taking their lives into their own hands when they play with it in scopes where they shouldn't be playing with it. - Jamis On Jun 18

[Rails-core] Re: with_scope should not be protected.

2007-06-18 Thread Gabe da Silveira
Well why isn't it written in Java then? On 6/18/07, Mislav Marohnić <[EMAIL PROTECTED]> wrote: > On 6/19/07, dasil003 <[EMAIL PROTECTED]> wrote: > > > > Since when has Rails been about protecting programmers from themselves? > > Since, um ... forever? > > > > -- Gabe da Silveira http://darwinw

[Rails-core] Re: with_scope should not be protected.

2007-06-18 Thread Mislav Marohnić
On 6/19/07, dasil003 <[EMAIL PROTECTED]> wrote: > > > Since when has Rails been about protecting programmers from themselves? Since, um ... forever? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Co

[Rails-core] with_scope should not be protected.

2007-06-18 Thread dasil003
I recently upgraded my edge rails in order to take advantage of the view_paths patch Rick applied the other day, and discovered with_scope is now protected. I'm well aware of the abuses of with_scope, but isn't this approach sort of heavy-handed? Since when has Rails been about protecting progra

[Rails-core] Re: Better Modularization for Rails 2.0

2007-06-18 Thread Julio Santos Monteiro
I agree with David. I think that the Rails development team should now develop more high-level reuse of the sub-set than changing all the base Rails was created. I am not saying that the "Django-style" is bad, I really like it. But Rails-style is nice and cool to, so why change something that wor

[Rails-core] Re: Better Modularization for Rails 2.0

2007-06-18 Thread james.thompson
I like the idea overall but I don't like throwing my views in with my code. Perhaps keeping the views in another subfolder (within a particular 'slice') would maintain the notion of separation of concerns a little better. Otherwise I'm a fan of the idea. -James --~--~-~--~~-

[Rails-core] Re: assert_template... what's the reasoning for looking at the first rendered file?

2007-06-18 Thread Andrew Kaspick
I'll see if I can come with a patch soon. I took a quick glance at the code, but I didn't see an obvious fix. I only spent about 10-15 mins looking though. Andrew On 6/15/07, Tammer Saleh <[EMAIL PROTECTED]> wrote: > > We've just run into this problem ourselves, when playing with the > idea of