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
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
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
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
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
> 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
> 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
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
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
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
+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
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
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
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
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
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
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
--~--~-~--~~-
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
18 matches
Mail list logo