Displaying 2 results from an estimated 2 matches for "requester_user_id".
2006 Feb 26
3
Rails Naming Conventions
DB field names:
If I have a table that references 2 or more separate users from my users
table, is there a recommended naming convention for this situation? In
my case, I have 3 users associated with a record in my projects table:
requester_user_id
created_by
updated_by
I could name one of them "user_id", and then projects.user would work I
guess, but wouldn''t work for the others. Is there a recommendation for
this kind of situation?
Plurality in Classes:
Not in class names as much as in the part where you say bel...
2006 Feb 25
7
Help with DRY: too much code in my view
...a list view of "projects" (main table),
I have this code in the list.rhtml:
<%
odd_or_even = 0
for project in @projects
@project_translations = ProjectTranslation.find(project.id)
@business_unit = BusinessUnit.find(project.business_unit_id)
@requestor = User.find(project.requester_user_id)
@vendor_projects =
VendorProject.find_by_project_translation_id(@project_translations.id)
@vendor = Vendor.find(@vendor_projects.vendor_id)
odd_or_even = 1 - odd_or_even
%>
This code I would probably need in other views as well. For the list
that customers see, for individual record...