[Rails] ACTIVE RECORD ASSOCIATIONS TIPS AND TRICKS

2012-04-16 Thread Vanita Kothari
Hi, Here is an interesting and informative blog that might be very useful for ROR professionals. Hope people can take advantage of this information via your forum. http://www.idyllic-software.com/blog/active-record-associations-tips-and-tricks/ Cheers! -- You received this message because you

Re: [Rails] ACTIVE RECORD ASSOCIATIONS TIPS AND TRICKS

2012-04-16 Thread vishal singh
excellent blog. On Mon, Apr 16, 2012 at 12:55 PM, Vanita Kothari van...@idyllic-software.com wrote: Hi, Here is an interesting and informative blog that might be very useful for ROR professionals. Hope people can take advantage of this information via your forum.

[Rails] Active Record Associations - best way to find all items assosciated with a specific company

2011-10-04 Thread Jim Burgess
I have the following associations in my models: item.rb belongs_to :manufacturer, :class_name = Company belongs_to :distributor, :class_name = Company company.rb has_many :items My question: what is the best way to find all of the items belonging to a specific company? If I call Company.items

Re: [Rails] Active Record Associations - best way to find all items assosciated with a specific company

2011-10-04 Thread Colin Law
On 4 October 2011 21:35, Jim Burgess li...@ruby-forum.com wrote: I have the following associations in my models: item.rb belongs_to :manufacturer, :class_name = Company belongs_to :distributor, :class_name = Company company.rb has_many :items My question: what is the best way to find all

Re: [Rails] Active Record Associations - best way to find all items assosciated with a specific company

2011-10-04 Thread Colin Law
On 4 October 2011 21:40, Colin Law clan...@googlemail.com wrote: On 4 October 2011 21:35, Jim Burgess li...@ruby-forum.com wrote: I have the following associations in my models: item.rb belongs_to :manufacturer, :class_name = Company belongs_to :distributor, :class_name = Company

Re: [Rails] Active Record Associations - best way to find all items assosciated with a specific company

2011-10-04 Thread Colin Law
Trying again. On 4 October 2011 21:44, Colin Law clan...@googlemail.com wrote: On 4 October 2011 21:40, Colin Law clan...@googlemail.com wrote: On 4 October 2011 21:35, Jim Burgess li...@ruby-forum.com wrote: I have the following associations in my models: item.rb belongs_to :manufacturer,

[Rails] Active Record Associations and papermill

2010-06-02 Thread DmitryPush
I have a model Chapter I figured out how to add assets to chapter through papermill plugin. Now the question: how can i add additional description to each asset? It can look like: chapter has_many items item belongs_to chapter item has_one papermill_asset papermill_asset belongs_to item But i

[Rails] Active Record associations performance

2009-10-14 Thread Anton Ivanov
Hi, I'm running into a memory performance issue with Active Record associations. I'm tinkering with Redmine, a rails-based project management application. The central model in the application is 'Project' which associates via has_many to model Issue. One of the things you can do with Projects

[Rails] Active Record Associations and application outline advice

2009-08-17 Thread Adam Akhtar
Hi if i have one model say with objects for each letter of the alphabet e.g a,b,c ... x,y,z and i want to allow users to create there own favourite pairings of these e.g. ab, cd, ef, gp and allow them to discuss via comments on each pairing, whats teh best way to model this in rails? the order

[Rails] Active Record Associations

2009-02-10 Thread James Bond
I have tables: users (id, name) computers (id, name) mobiltelefons (id, name) OwnComputers (id, user_id, computer_id) OwnMobiltelefons (id, user_id, mobiltelefon_id) So is it has_many :through or has_and_belongs_to_many or what? I only need to search one own table at time: All computers that

[Rails] active record associations

2008-11-06 Thread Franz
What's wrong with ruby associations? Somehow association fields don't have any support for dirty objects nor optimistic locking. I would expect dirty objects to work like this: class Person has_many :cars end person = Person.find_by_name(Jack) person.cars = [#Car id: 2, name: BMW,

[Rails] active record associations

2008-11-05 Thread Franz
I want to accomplish the following. I have an object that can be edited. However, it can occur that two people might edit the object at the same time. Instead of locking the object down, I prefer to tell the user how their version differs from the last version that was committed. Kinda like: