search for: task_ids

Displaying 20 results from an estimated 48 matches for "task_ids".

Did you mean: task_id
2006 Apr 30
4
Adding values from a db the rails way?
I have a log table which has a column recording the number of hours worked on a task. So there''ll be multiple lines for a particular task. I want to retrieve the total number of hours worked on a task, so that I can include the information when one views the task details. I can write a sql query to do this easily enough, like "SELECT SUM(hours) AS total FROM tasklog WHERE
2006 May 23
8
ad-hoc query
How do you run an ad-hoc query that does not belong in any model? I thought it was something like ActiveRecord::connection.find("my query..."), but I can''t seem to find the documentation on it. I know I''ve seen it somewhere before, though. thanks, Jeff -- Posted via http://www.ruby-forum.com/.
2008 Apr 23
0
self referential (n-n relationship) belongs many controller
...ort''], params[''order''], ''tasklink_id'', ''ASC'') end def create @task = Task.new(params[:task]) @link = Link.new(params[:link]) @links = Link.find_all @tasks = Task.find_all @statuts = Statut.find_all #if @params[:task_ids] #@task.tasklinks = Task.find(params[:task_ids]) #else #@substance.risques = [] #end #ca foire un max if @task.save @link.task_id = @task.id @link.tasklink_id = Task.find(??????).task_id @link.save flash[:notice] = ''L action a été créée'' redirect_to :action =>...
2006 Aug 09
0
select-multiple for has_many association
I haven''t looked into this for several months, but there still doesn''t seem to be an obvious way to generate a HTML select element for choosing multiple items to be set for a has_many association. <select id="person_task_ids" multiple="multiple" name="person[tasks][]"> <option value="1">Do something</option> ... </select> Let''s see. There''s a handy helper method that results in code like this, when used straightforwardly <%...
2006 Mar 21
3
Newbie - ActiveRecord relationships
So I''ve worked through Agile Web Development with Rails and I''m now trying my first little app to get into the swing of things. Its a task tracking app where people can create tasks and assign them to others, and also log time against the tasks. I''m having trouble working out the model relationships. This is what I''ve got so far, but its not right as
2012 Sep 13
3
Creating a link_to from a collection_select
I want to be able to change one attribute of a link_to to be what is the current selection of the collection_select. And needless to say I can''t quite figure it out. app/views/tasks/show.html.erb Who would you like to assign this task to?<br /> <%= link_to ''Myself'', :controller => ''task_queues'', :task_id => @task.id, :action =>
2006 Jul 16
4
Calculations across multiple tables
I have a time tracking app where (pseudo-code) Client has_many Task has_many TimeRecord TimeRecord start_at, :datetime end_at, :datetime What I''m trying to do (and I have done using find_by_sql in the past) is get a sum of the timespan given by ended_at - begun_at for each client. Is it naive to imagine that AR''s calculations will span relations to provide a grouped
2013 Mar 25
1
validates presence of foreign key fails in nested form
I''m using accepts_nested_attributes as follows: class Timesheet < ActiveRecord::Base attr_accessible :status, :user_id, :start_date, :end_date, :activities_attributes has_many :activities, dependent: :destroy has_many :time_entries, through: :activities accepts_nested_attributes_for :activities, allow_destroy: true end class Activity < ActiveRecord::Base attr_accessible
2007 Dec 04
10
ActiveRecord::AssociationTypeMismatch
I have the requirement to empty the association records and add the association records as new (as below). @task = Task.find(params[:task_id]) @task.task_users = [] params[:ids].split(", ").each do |court_user_id| task_user = TaskUser.new(:court_user_id => court_user_id) @task.task_users << task_user end @task.save This is not working. Following error is thrown.
2018 Oct 16
2
high cpu load with share_conflict on browsing and opening files
Hello, I have a server running samba version 4.7.1 on centos 7.5 1) A series of operations by a windows 10 (up to date) pc client consisting of  searching (or browsing)/opening/modifying/closing a (each time different) file multiple times on a samba share containing many files (more than 11000) goes fast for a while. 2) Then the same operation (or just the searching or opening) of the same user
2006 Apr 28
5
Newbie: using date-picker
Finally found a nice date chooser script (http://projects.exactlyoneturtle.com/date_picker), but am a little confused how to implement it. So I put this where I need the date picker: <a id="_name_link" href="#" onclick="DatePicker.toggleDatePicker(''name'')" class="demo_link">[ choose date ]</a> <div
2006 Apr 27
0
last stupid question today
(well, from me anyway. I promise) Trying to follow the "Self-referential Many-to-Many Relationships" recipe from the Rails Recipes book. This is what I''m doing: Tasks can have a predecessor relationship with each other. My Task class has this: has_and_belongs_to_many :predecessors, :class_name => "Task", :join_table => "predecessor",
2008 Feb 19
0
Issue with Observers and has_one association...
Hey Guys, I''m getting a peculiar bug working with Observers and has_one associations. When a has_one association is invoked by an Observer it always returns null. I looked in the development.log file and the SQL for the has_one association isn''t even being executed. On the other hand, when I replace the has_one association with just a hand crafted method, it does get called
2010 Jan 22
0
Problem with acts_as_commentable Plugin
Hi, i''m trying to use the acts as commentable Plugin, bit it seems not to work: My Commentable Model is the Task Class. if i try to get the Comments of a Task Object , e.g. task.find(:first) task.comments it occurs this error: ActiveRecord::StatementInvalid: Mysql::Error: Unknown column ''comments.task_id'' in ''where clause'': SELECT * FROM
2008 Jun 14
0
does BackgrounDRB not "know" the rails environment it is running within/in parallel with?]
Hi, it probably is a noob question but I''m confused by this error message: active_support/dependencies.rb:478:in `const_missing'': uninitialized constant Invoice::ApplicationController Situation: I have an InvoicesController with a create method that in turn calls upon a MiddleMan.worker(:billing_worker), which in turn finds an Invoice and calls upon @invoice.print_invoice
2008 Sep 06
6
Active record question
I''m not quite sure how to get at this data using Actrive record.. I''m trying to get all the appointments made for a particular project. I''m using four models, Projects, Tasks, Resources and Appointments. The SQL gets me what I''m looking for but how do I do it using Active Record? Select a.* from appointments a join resources r on r.id = a.resource_id join
2006 Jul 27
1
Update second pulldown menu based on first menu selection?
I know I''ve seen this somewhere on this board and just can''t search it anymore. I have three relational tables: clients, projects, and tasks. Currently I''m working on customizing the ''new/edit'' task _form. So far I have it listing clients in a pulldown menu so I can assign the new task to a client. I''d like to have a second pulldown select
2006 Mar 23
3
drag and drop sorting recipe
The new pragmatic Rails Cookbook has a drag and drop sorting recipe. Does anyone know if this works with 1.0? I''ve followed the recipe (i think), and I can drag but when I drop everything goes back the way it was. It seems that the sort logic doesn''t get invoked. I put this code in my view: <%= sortable_element ''task-list'' , :url => {
2010 Aug 21
2
Making a series of similar, but modified .r files - suggested method(s)?
Dear all: Any suggestions are much appreciated. I am looking for a way to make a series of similar, but slightly modified, .r files. My issue is automating making 320 .r files that change the for(i in 1:x) in my base .r file (as well as other elements, e.g., the load(...), setwd(...)). For smaller jobs running on a single computer with batch files, I have been manually changing the for(i in 1:x)
2014 Mar 24
0
Winbind logins failing after upgrade from Samba 3 to Samba 4
Hello, I have a RHEL 6.5 server that was configured to use Samba 3.6.9-167 to authenticate against a Windows 2008 R2 Active Directory domain. The authentication was working fine, but we needed users to log in to this RHEL box with their AD credentials and then access files stored on a Windows file server CIFS share globally mounted on the RHEL box. As such, we added the "cifsacl"