Re: [Rails-core] Namespacing Models et al

2014-04-15 Thread Xavier Noria
On Wed, Apr 16, 2014 at 2:43 AM, Stephen Paul Weber < singpol...@singpolyma.net> wrote: The case I've run into the gem *is* namespaced, but with a name that > clashed with one of my model names. Rails as currently implemented does > not control the namespace, but given how the autoloader works I

Re: [Rails-core] Namespacing Models et al

2014-04-15 Thread Stephen Paul Weber
The case I've run into the gem *is* namespaced, but with a name that clashed with one of my model names. Rails as currently implemented does not control the namespace, but given how the autoloader works I don't see any reason it couldn't. A middleground would be to have the autoloader expect

Re: [Rails-core] Namespacing Models et al

2014-04-15 Thread Xavier Noria
Rails does not control the namespace. User is defined when user.rb is evaluated. Autoloading finds user.rb if the User constant is unknown, and admin/user.rb if Admin::User is unknown, but namespace usage is up to the application. In my view, namespacing is something code meant to be shared shoul

Re: [Rails-core] Namespacing Models et al

2014-04-15 Thread Rodrigo Rosenfeld Rosas
I support the overall idea. Em 15/04/2014 18:12, "Stephen Paul Weber" escreveu: > Just ran into this for the first time and thought it was worth talking > about: because models and controllers and such just live in the root > namespace, they can be shadowed when importing a gem. > > My proposal

[Rails-core] Namespacing Models et al

2014-04-15 Thread Stephen Paul Weber
Just ran into this for the first time and thought it was worth talking about: because models and controllers and such just live in the root namespace, they can be shadowed when importing a gem. My proposal (for discussion) is that Rails could put all the app classes inside the module that ex

Re: [Rails-core] Re: ActiveRecord chained order calls composed

2014-04-15 Thread James Coleman
It's true that relations as sets that to feel a whole lot like arrays, but the fact that query conditions are composable (and no one is arguing that they shouldn't be) implies that other operations should also be composable. To have conditions be composable and orderings not would be an impedance m

[Rails-core] Re: ActiveRecord chained order calls composed

2014-04-15 Thread Cameron Martin
Relational algebra deals with sets, and sets are collections. Standard relational algebra doesn't define an order by operator, but if you want define an order between the elements in the set, you're getting towards something which behaves quite a lot like an array. James, I see your point about