search for: assigned_tasks

Displaying 4 results from an estimated 4 matches for "assigned_tasks".

2006 Apr 22
0
Newbie - list based on joined query?
...legatedtasks = paginate :tasks, :conditions => "user_id = " + session[:user_id].to_s + " percent_complete <> 100", :order_by => ''due_on asc'' I''d like to only list the tasks which have been assigned to other people. I have a table called assigned_tasks which links my tasks to the users. A straight SQL query to accomplish this might be SELECT * FROM tasks INNER JOIN assigned_tasks ON tasks.id = assigned_tasks.task_id WHERE tasks.user_id = x AND assigned_tasks.user_id <> x How do I accomplish this with rails? -- Posted via http://www.r...
2006 May 01
3
Make a checkbox checked based on a condition?
I have a series of checkboxes in a form generated as follows: <% for user in @active_users %> <p><%= user.firstname + " " + user.surname%> <%= check_box ''assigned_tasks'', ''user_id'', {:index => user.id}, user.id, nil %></p> <% end %> I''d like to have one of them selected when user.id is equal to the value of the logged in user, stored in session[:user_id] How do I do that? thx N. -- Posted via http://www....
2006 Aug 07
4
multiple habtm joins on the same two tables
i have a taskmanager type of project that i am working on, where i need to separate joins on the same two tables. i need one join for users that are assigned to the task, and another join for who has read the task, so they can tell which ones are new. any suggestions on the best way to accomplish this? thanks -- Posted via http://www.ruby-forum.com/.
2006 Apr 21
2
destory Test Case Messes up all tests
...rst_user.email end # Test deleting of user def test_destroy @first_user.destroy assert_raise(ActiveRecord::RecordNotFound) {User.find(@first_user.id)} end end Here is the model : require "digest/sha1" class User < ActiveRecord::Base has_many :tasks has_many :assigned_tasks attr_accessor :password validates_presence_of :firstname, :surname validates_presence_of :password, :on => :create validates_confirmation_of :password, :on => :create validates_format_of :email, :with => /^(.+)@(.+)\.[A-z]{2,6}$/ validates_uniqueness_of :email def self.log...