search for: project_id

Displaying 20 results from an estimated 104 matches for "project_id".

2011 Oct 16
2
question: ragged array
Hello, I have a big problem which I’m just not able to solve. I created the following mean value from the following dataset structure: Id |value 1 | 2 1 | 3 1 | 4 2 | 2 2 | 1 3 | 5 4 | 3 etc.|etc. with the command: mean_rating <- tapply(ratok$value, ratok$project_id , mean,simplify = FALSE) this gives me a ragged array: > mean_rating [1] $`14` ###########==project_id [1] 3.933333 #######==mean value > dim (mean_rating) [1] 2214 I want to separate now the project_id from the mean value. So that I have two separate columns (2 dimens...
2007 Jul 22
2
Seek brilliant Rails programmer to add one field to acts_as_taggable
...hough the tag.rb instance is magically created without leaving a trail or sequence of events that I can modify. I was hoping I could ''go in the front door'' and simply modify the ''tag_with'' code such as this; module InstanceMethods def tag_with(list, project_id) Tag.transaction do taggings.destroy_all Tag.parse(list).each do |name| if acts_as_taggable_options[:from] send(acts_as_taggable_options[:from]).tags.create(:name => name, :project_id => project_id).on(self) else...
2008 Jun 13
2
Rails 2.1.0 - find with :include and missing JOIN in SQL query
...ve to 1.2.6 and now we''re trying with 2.1.0. One of the problems is caused by :include in AR.find. Rails 1.2.6 generates totally different SQL query than 2.1.0. Here''s Rails find query and generated SQL queries: Foo.find(:all, :include => :ticket, :conditions => (''project_id => 1'')) Rails 1.2.6 SELECT foos.`id` AS t0_r0 ... FROM foos LEFT OUTER JOIN tickets ON tickets.id = foos.ticket_id WHERE (project_id = 1) # works fine Rails 2.1.0 SELECT * FROM `foos` WHERE (project_id = 1) # JOIN is missing and Rails complains about missing project_id column in foos...
2006 Jun 01
4
can''t convert Fixnum into String ??
I have been getting this error message on various pages, just wondering if anyone could explain whats going wrong, and the best way to correct it code that is cuasing the problem is below @project = Project.find(:first, :conditions => "id = " + @purchaseorder.project_id) -- Posted via http://www.ruby-forum.com/.
2007 Nov 02
5
RSpec, RESTful nested routes and :path_prefix
Dear list, In the app we are making we have a rout something like this: map.resources :projects do |projects| projects.resources :pages, :controller =>"Wiki::Pages", :path_prefix => "/projects/:project_id/ wiki", :name_prefix => "project_wiki_" end But I can''t get RSpec(I''m very new to it) to accept this. It keeps throwing errors: ActionController::RoutingError in ''Wiki::PagesController POST ''create'' should be successful'' No...
2007 Nov 14
6
a few add_index questions..
...lot more foreign keys. so i have 3 tables... users, projects, and tasks.. should i be using add_index on every foreign key in all of the tables? in my tasks table, i''m going to have a foreign key for the user and the project. seems like i could add up to 3 indexes.. add_index :tasks, [:project_id] add_index :tasks, [:user_id] add_index :tasks, [:project_id, :user_id], :unique => true i realize this might not be the group to be asking about when and where to add indexes and keys to a database, but in the context of ruby and rails i just thought i would see what other people do. would add...
2008 Oct 30
1
Nested Resouces,not getting parent id(project_id) from form
Hi i am using nested resources,here project having has many relation with defects. Main problem here is i am not getting project_id from edit form.What''s a problem if any one knows please help. edit.html.erb <% form_for(@defect,@project) do |f| %> <%=f.text_field :name%> <%end%> routes.rb map.resources :projects,:has_many=>:defects map.resources :defects defecs_controller.rb before_filter :...
2007 May 06
1
validates_uniqueness_of (with :scope) doesn't seem to work?
I have a master record called ''project'' and a child record called ''agycode''. Obviously, agycode has a project_id FK. I wish to make the "descr" field unique ONLY within the ''project_id'' ''scope''. Here are the key pieces of information Agycode fields (id, project_id, descr) Here''s the declaration in the Agycode.rb validates_uniqueness_of *:descr*, *:scope*...
2008 Sep 06
6
Active record question
...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 tasks t on t.id = r.task_id join projects p on p.id = t.project_id Where project_id = 1; I can get all the Resources for a project using this but can not get the appointments. I could loop through the resources getting all the appointments and tracking them, but that doesn''t seem like the right way to do it. I could also use find_by_sql, but again, tha...
2012 Mar 26
3
render :json not sending any data back ...
[rails 3.2.2] I perform an ajax call : ... $.ajax url: " /backoffice/expenses/rate" type: "GET" dataType: "json" data: project_id: $(''#project_id'').val() code: $(this).val() success: (result) -> alert result $(''#expense_price'').val(result) in the controller , I am correctly receiving the js call Started GET "/backoffice/expenses/rate?project_id...
2005 Nov 16
1
HABTM: deleting records based on attributes
Hello All, I am new to ROR, and can''t seem to get HABTM to cooperate entirely... however I might be abusing it! Before I try a different strategy I thought I''d ask here and see if I''m missing something simple. So say Projects and Companies are related. Projects can have multiple Companies, and Companies can be on multiple Projects. But, the same Company can also
2006 Apr 25
4
Newbie - Grouping of items...
...e I add or update another model (like messages, comments, lists etc) an enrty gets added to the log along with the project. I can see this being an overkill and the duplication of data is not correct. (2) In my controller perform a query that searches every model for every item against a given project_id. The order the results by "updated_on". Then select the last 5 for each result. This seems really complicated and perfoms many SQL queries Does rails/ruby have a better way of achieving this? What have you done in your projects that works reliably and quickly? Many thanks -- Posted...
2006 Jan 16
0
belongs_to with has_and_belongs_to_many
...ecord::Base set_primary_key ''member_id'' has_and_belongs_to_many :projects, :join_table => ''projects__members'' has_many :projects, :foreign_key => ''created_by'' end class Project < ActiveRecord::Base set_primary_key ''project_id'' belongs_to :created_by, :class_name => ''Member'', :foreign_key => ''created_by'' has_and_belongs_to_many :members, :join_table => ''projects__members'' end And the DDL: create table members ( member_id serial primary...
2007 Apr 25
2
form_remote_for, reloaded
...f.date_select(:day, :disabled => true, :order => [:day, :month]) %> <td><%= f.date_select(:day, :order => [:day, :month]) %></td> <td><%= f.collection_select(:user_id, @users, :id, :login_name) %></td> <td><%= f.collection_select(:project_id, @projects, :id, :name) %></td> <td><%= f.text_field :quantity, :size => 4 %></td> <td><%= f.text_field :description, :size => 50 %></td> <td><%= submit_tag "Zeit Erfassen", :class => "submit" %></t...
2006 Apr 16
2
Making requests in order
...o request that the assigned person perform each of the steps, and need to make sure that I cannot request that the next step be done unless the previous one has been completed. What I have thought is to have a projects table and another table named project_steps with fields: id, name, ordernum, project_id. The ordernum tells the order in which the steps must be performed. Then, create another table, nextsteprequest, with fields: id, project_id, project_step_id. I was thinking that when I request the next step be done I would have the app check to see if the numbers matched up, thus either allow...
2006 Feb 11
6
Rails Edge, has_many :through in searches
...es, this worked fine: @projects = Project.find(:all, :include => [:client], :conditions => ["client.name like ? or project.name like ?", @query, @query]) However, doing this using the has_many :through technique doesn''t seem to work, as it tries to joint "clients.project_id" to "projects.id," which won''t work because they''re not directly linked. Is this a known issue, or is this by design?
2005 Nov 19
3
Form values not included in submit when ajax generated.
Hi. I have a form with two select lists, named ''project'' and ''activity''. The content of the ''activity'' list is changed when the selected item in project changes, using ''observe_field'' where project is observed, and a div enclosing ''activity'' is updated. This works as expected. The problem is that when
2012 Jun 30
5
Problems with associations
Hello guys, I have two tables, tasks and projects, and each model I put: Task.rb class Task < ActiveRecord::Base attr_accessible :user_id, :project_id, :name belongs_to :project end Project.rb class Project < ActiveRecord::Base attr_accessible :name, :description has_many :tasks end But when I go to my prompt and I make a SELECT with task, none project is returned. irb(main):001:0> Task.all ←[1m←[36mTask Load (0.0ms)←[0m ←[1mSE...
2006 May 08
4
set forign key
hi, got a small problem below and not to sure how to overcome this using rails two tables involved with this projects and quotes each project has a field quote_id as a forign field. When a user is ready to upload a quote they are linked to quotes/new from the show project page. Once the quote is uploaded how can I then set the quote_id field with the correct key? -- Posted via
2006 May 31
1
find by sql
...is, but gaining the same results. thanks scott #sql to find all invoices pSql = "SELECT DISTINCT invoices.id, invoices.invoice_number, invoices.approve_date, invoices.sent_date, invoices.paid_date FROM projects, payments, invoices WHERE projects.id = payments.project_id AND payments.invoice_id = invoices.id AND projects.id = " + params[:id] + " ORDER BY invoices.id" @invoices = Invoice.find_by_sql(pSql); -- Posted via http://www.ruby-forum.com/.