[Rails-core] STI and routes

2013-10-09 Thread Francesco Boffa
I would like to contribute to Rails. Specifically I'd like to add a feature, and before I write any code I'd like to receive some feedback from you guys. When using Single Table Inheritance, all path/url helpers for the parent resource will not work for the child resources. For example: class U

Re: [Rails-core] STI and routes

2013-10-09 Thread Ryan Bigg
Why not use becomes? link_to "posts", [student.becomes(User), :posts] That would force the object to become a User, so you would only need routes for users and not its subclasses. On Wed, Oct 9, 2013 at 9:43 PM, Francesco Boffa wrote: > I would like to contribute to Rails. Specifically

Re: [Rails-core] STI and routes

2013-10-09 Thread Tejas Dinkar
On 09-Oct-2013, at 4:17 PM, Ryan Bigg wrote: > link_to "posts", [student.becomes(User), :posts] :-( I don't find this very Object Oriented. It actually builds a User Object, so methods on Student will not work. Also it's bound to be forgotten form_for professor.becomes(User) do |f| f.text_fie

[Rails-core] Query caching in active record

2013-10-09 Thread Stewart
Hi, It seems that Active record query caching is all done in memory. This is fine untill you need to run with unicorn that will have multiple workers each with their own connection. It would be nice to be able to configure a query caching backend in the same way active support configures cachi

Re: [Rails-core] Query caching in active record

2013-10-09 Thread Brian Morearty
Hi, I don't think that would work well for the purpose that query caching serves. Query caching takes advantage of the fact that Rails is for web apps, which operate in request-response cycles. Each request starts with a clean cache. The query cache is there so that within the scope of handling a

Re: [Rails-core] Query caching in active record

2013-10-09 Thread Godfrey Chan
I thought query caching is per-request?  (thread?) Is there a scenario where sharing the query cache is appropriate? Godfrey — Sent from Mailbox for iPhone On Wed, Oct 9, 2013 at 9:32 PM, Stewart wrote: > Hi, > It seems that Active record query caching is all done in memory. This is > fin