Displaying 2 results from an estimated 2 matches for "user_operation_types".
2005 Aug 28
6
ActiveRecord Question
...n_types tables as needed.
Now for a given user, I want to fetch all the types of the operations associated with her (OperationType classes).
So there is one very inefficient way that goes like this:
(suppose user_id holds the user id)
user = User.find(user_id)
user_operations = user.operations
@user_operation_types = Array.new
for op in user_operations
operation_type = op.operation_type
if !@user_operation_types.include? operation_type
@user_operation_types << operation_type
end
end
And I get all the operation types associated with the user''s operations in the @user_...
2005 Aug 28
1
Active Record problem
...n_types tables as needed.
Now for a given user, I want to fetch all the types of the operations associated with her (OperationType classes).
So there is one very inefficient way that goes like this:
(suppose user_id holds the user id)
user = User.find(user_id)
user_operations = user.operations
@user_operation_types = Array.new
for op in user_operations
operation_type = op.operation_type
if !@user_operation_types.include? operation_type
@user_operation_types << operation_type
end
end
And I get all the operation types associated with the user''s operations in the @user_...