[Rails-core] Re: RFC: Enterprise-ready internationalization (i18n) for Rails

2009-04-22 Thread Sven Fuchs
Hey guys, thanks a lot for you proposal. I think we all agree that rails-i18n can be improved and input on that is highly appreciated. This is a very long mail, so I'll cut some of it. On 21.04.2009, at 11:08, geekQ wrote: All our approaches still required extensive monkey patching

[Rails-core] ActiveRecord::Base.exists? incompatibility with :include scopes fixed

2009-04-22 Thread Peter Marklund
Hi! I was using a default scope with an :order option as well as an :include option and came across a bug in the ActiveRecord::Base.exists? method. It turns out it drops any :include option from the current scope. My solution is a bit radical maybe, but simple. I have exists? invoke find_initial

[Rails-core] Re: RFC: Enterprise-ready internationalization (i18n) for Rails

2009-04-22 Thread geekQ
I noticed that the formatting somehow got screwed up. You may find the html version easier to read http://github.com/geekq/rails/blob/854140d9401ee25fae5b5e0f8c1436818507e796/rfc-internationalization.markdown Regards, Vladimir --~--~-~--~~~---~--~~ You received

[Rails-core] flash

2009-04-22 Thread Amos King
Should flash still be persisting through redirects? Until the recent release, when I had: flash[:error] = Foo redirect_to login_url The flash would be populated and displayed on the login page. Now the flash is being cleared. Is this intentional, and if so why? -- Amos King aka: Adkron

[Rails-core] Re: flash

2009-04-22 Thread John Trupiano
Are you sure there's not a double redirect? This can happen if you're using a plugin like ssl_requirement, where the initial redirect to login_path goes to port 80, then the plugin jumps in and redirects to the same url on port 443. -John On Wed, Apr 22, 2009 at 7:30 AM, Amos King

[Rails-core] Re: RFC: Enterprise-ready internationalization (i18n) for Rails

2009-04-22 Thread Chris Cruft
Get this man hooked up to the wagon! It's great to see this level of thought going into Rails I18n, and equally wonderful to know that his efforts could positively impact the framework. On Apr 21, 5:08 am, geekQ vladimir.dobria...@innoq.com wrote: We have been working on a Rails application

[Rails-core] Re: flash

2009-04-22 Thread Amos King
We are only using ssl. It worked before the last upgrade. I can't find a double redirect. On Wed, Apr 22, 2009 at 7:10 AM, John Trupiano jtrupi...@gmail.com wrote: Are you sure there's not a double redirect?  This can happen if you're using a plugin like ssl_requirement, where the initial

[Rails-core] Re: has_many :through scoped association

2009-04-22 Thread Chris Cruft
I've expanded my monkey patch (see it here: http://gist.github.com/88448) to the point where I wouldn't call it proof of concept anymore. It works very nicely in practice as well. The concept of scoped associations and composing of scopes, regardless of my implementation, seems strong. Luke, I

[Rails-core] Built associations don't know their parent. Why not?

2009-04-22 Thread hakunin
(Just posted it in Talk and realized it makes more sense to ask here.) Simple example. class Car ActiveRecord::Base has_one :engine validates_presence_of :engine validates_associated :engine end class Engine ActiveRecord::Base belongs_to :car validates_presence_of :car end @car

[Rails-core] Re: [Ruby on Rails #1642] HasOneThroughAssociation should not be a child of HasManyThroughAssociation

2009-04-22 Thread DWF
Given that the GSOC Rails projects involve some ActiveRecord refactorings, doesn't this type of improvement make sense? --dwf On Mar 8, 12:42 pm, Niels Ganser ni...@herimedia.com wrote: I realize us Rubyists don't necessarily think the classic works in the field such as Fowler's Refactoring

[Rails-core] Re: [Ruby on Rails #1642] HasOneThroughAssociation should not be a child of HasManyThroughAssociation

2009-04-22 Thread Pratik
Which problem is it solving for you ? Do you see any performance gains that I'm missing ? Do you believe if this is making any code easier to understand ? Could you please provide failing tests which are to be fixed by the refactoring in question ? Thanks. On Wed, Apr 22, 2009 at 6:15 PM, DWF

[Rails-core] Re: Built associations don't know their parent. Why not?

2009-04-22 Thread Eloy Duran
I agree. Please write a patch :) Eloy On 22 apr 2009, at 18:18, hakunin wrote: (Just posted it in Talk and realized it makes more sense to ask here.) Simple example. class Car ActiveRecord::Base has_one :engine validates_presence_of :engine validates_associated :engine end

[Rails-core] Re: Built associations don't know their parent. Why not?

2009-04-22 Thread Flinn Mueller
Shouldn't you be validating presence of the key rather than the object itself? On Apr 22, 2009, at 2:29 PM, Eloy Duran wrote: I agree. Please write a patch :) Eloy On 22 apr 2009, at 18:18, hakunin wrote: (Just posted it in Talk and realized it makes more sense to ask here.)

[Rails-core] Re: Built associations don't know their parent. Why not?

2009-04-22 Thread Eloy Duran
A key wouldn't be possible because you'd need to save a possibly invalid record first to be able to do that. Let me note that I don't necessarily have a need for validate_presence_of to work in this case, but rather the ability of having the parent object around when doing stuff in the

[Rails-core] Re: Built associations don't know their parent. Why not?

2009-04-22 Thread hakunin
Eloy, I'll give it a shot. : ) Flinn, not necessarily. In this case we talk about associated in- memory object which doesn't have id yet. In my opinion validates_presence_of :engine_id should behave the old way - check for id - since we explicitly ask for it. On Apr 22, 2:52 pm, Flinn Mueller

[Rails-core] Re: Built associations don't know their parent. Why not?

2009-04-22 Thread hakunin
Well, if the child cannot exist without parent, it seems natural to have such validation in the child - must have parent. (In addition to your reasoning.) On Apr 22, 3:26 pm, Eloy Duran eloy.de.en...@gmail.com wrote: A key wouldn't be possible because you'd need to save a possibly   invalid

[Rails-core] Re: [Ruby on Rails #1642] HasOneThroughAssociation should not be a child of HasManyThroughAssociation

2009-04-22 Thread Chad Woolley
On Wed, Apr 22, 2009 at 10:51 AM, Pratik pratikn...@gmail.com wrote: Which problem is it solving for you ? Do you see any performance gains that I'm missing ? Do you believe if this is making any code easier to understand ? Could you please provide failing tests which are to be fixed by the

[Rails-core] Re: Built associations don't know their parent. Why not?

2009-04-22 Thread kscaldef
I had a closely related question today, which was why this code does N +1 queries? order.order_items.each {|oi| oi.order} Why must each order item do a query to find its order? It seems like Rails should recognize the reciprocal nature of the associations. -kevin On Apr 22, 9:18 am,

[Rails-core] Re: Built associations don't know their parent. Why not?

2009-04-22 Thread Michael Koziarski
On Thu, Apr 23, 2009 at 9:16 AM, kscaldef kevin.scaldefe...@gmail.com wrote: I had a closely related question today, which was why this code does N +1 queries? order.order_items.each {|oi| oi.order} Why must each order item do a query to find its order?  It seems like Rails should

[Rails-core] Re: Built associations don't know their parent. Why not?

2009-04-22 Thread Jeremy Evans
On Wed, Apr 22, 2009 at 3:42 PM, Michael Koziarski mich...@koziarski.com wrote: On Thu, Apr 23, 2009 at 9:16 AM, kscaldef kevin.scaldefe...@gmail.com wrote: I had a closely related question today, which was why this code does N +1 queries? order.order_items.each {|oi| oi.order} Why must

[Rails-core] Re: Built associations don't know their parent. Why not?

2009-04-22 Thread Michael Koziarski
FWIW, that's basically how Sequel handles it, with the :reciprocal option, though instead of punting by default if multiple associations match, it picks the first matching association. The first matching association sounds like it could be prone to surprises but we could see how it plays out.

[Rails-core] Re: flash

2009-04-22 Thread Michael Koziarski
Should flash still be persisting through redirects?  Until the recent release, when I had: flash[:error] = Foo redirect_to login_url The flash would be populated and displayed on the login page.  Now the flash is being cleared.  Is this intentional, and if so why? No, and this works for

[Rails-core] expanding the range of fast_string_to_time

2009-04-22 Thread Kevin Scaldeferri
Recently, in looking at profiling data from two different applications, I found that something like 5% of the application's time was being spent in converting strings to times on database fetches. Digging in, I found that the fast routine for doing this only worked if there was no

[Rails-core] rubyonrails.org

2009-04-22 Thread Chris Kampmeier
It looks like a domain squatter grabbed rubyonrails.org -- anybody know what's going on there? http://reports.internic.net/cgi/whois?whois_nic=rubyonrails.orgtype=domain Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[Rails-core] Re: rubyonrails.org

2009-04-22 Thread Chris Kampmeier
Here's a screenshot, in case people are seeing different things due to DNS propagation-- http://skitch.com/kampers/bcapb/rails-consultants-ruby-code-api-at-rubyonrails.org On Apr 22, 6:08 pm, Chris Kampmeier chrisgkampme...@gmail.com wrote: It looks like a domain squatter grabbed

[Rails-core] Re: rubyonrails.org

2009-04-22 Thread Mike Gunderloy
Thanks for the heads-up. Core team is investigating; it's probably just an auto-renew that didn't. Mike On Apr 22, 2009, at 8:08 PM, Chris Kampmeier wrote: It looks like a domain squatter grabbed rubyonrails.org -- anybody know what's going on there?

[Rails-core] Re: ActiveRecord::Base.exists? incompatibility with :include scopes fixed

2009-04-22 Thread Michael Koziarski
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2543-make-activerecordbaseexists-invoke-find_initial-to-support-include-scopes#ticket-2543-2 Comments? Exists is only really for indicating whether or not there's a record associated with that ID, if you want to obey all