i have an internal app being used for tracking internal jobs inside the shop. the company has multiple divisions, and transfers jobs back and forth between divisions. each division has their own job numbering scheme as well. what i''ve done is set up a jobs table which has many job_tags, which is the table i use to store the job number and other specific info relating to that division. so each time i am displaying a job, to also get a it''s job_tag i started out with something like this: job.job_tags.find_by_division_id(@division.id).name to prevent the database getting hit each time on finding multiple jobs, i have something like this in the controller: jobs = Job.find(:all, :include => :job_tags, :conditions => [''job_tags.division_id = ?'', @division.id]) and in the view i use: job.job_tags.first.name this is proving to not be very flexible and any time i have to change the list ever so slightly for another page, i find myself duplicating a lot of code. ideally i would like to add something like has_one :job_tag, :condititions => [''job_tags.division_id = ?'', division.id] to my Job model and be able to pass the current division to it, or if there are better ways to manage this type of thing, i am very open to any suggestions. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---