similar to: Rails 2.1.0 - find with :include and missing JOIN in SQL query

Displaying 20 results from an estimated 4000 matches similar to: "Rails 2.1.0 - find with :include and missing JOIN in SQL query"

2008 Sep 02
2
Actionmailer - Multipart and Outlook?
Hi, I''m having issues with getting a consistent result with the emails I am sending using Actionmailer. Problem: Emails that I send with plain text, rich text, and attachments do not display the same results across GMail, Yahoo, Outlook and Thunderbird. Scenario: I am sending an email with text/plain, text/html, and 2 attachments using the code below, and I''ve specified the
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`
2006 May 31
1
find by sql
Hi I have the following code, which makes use of an sql statment to get the results required. However this just doesnt seem right for rails, as ive managed to develop the whole project without using any other pure sql. Is there a cleaner way of doing this, but gaining the same results. thanks scott #sql to find all invoices pSql = "SELECT DISTINCT invoices.id,
2007 Jul 22
2
Seek brilliant Rails programmer to add one field to acts_as_taggable
I''m on the downhill side of a large project that requires an additional integer field to be added to the tag.rb in acts_as_taggable. I feel I have a good understanding of ActiveRecord and have performed the correct migrations. (As a short background for those following this thread) when one wants to add tags to a model they call the ''tag_with'' method that jumps into
2006 Apr 26
10
save new model with child model
Hi, I am having a problem saving a new model that has an associated child model. If a new ticket is being created and will have one comment to go with it then I tried this in my action @ticket = Ticket.new(params[:ticket]) @comment = Comment.new(params[:comment]) @ticket.comments << @comment if @ticket.save @notice = "Ticket added. Thanks for
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
2019 Mar 23
2
Is this assumption correct?
Hello list we encounter a weird SSL issue with one of our dovecot (2.2.24 on Centos6) which we can only explain if our assumtion is correct Symptoms are that imaps connections (on port 993) suddenly get veeeery slow. Up to 180s for one connection with openssl s_client The thing we do not understand is that in the same time imap connections with starttls are just 1s. We can see that entropy on the
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:
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
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 14
6
a few add_index questions..
on previous apps i hadn''t really worried much about adding foreign key indexes on my tables just because they''ve been fairly small and i didn''t really think i needed them. well, i''m working on something now that has the potential to have a lot more data, and a lot more foreign keys. so i have 3 tables... users, projects, and tasks.. should i be using add_index
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
2008 Jul 04
2
How to make WHERE foo_id IN () query?
Hi, There are 3 models: A has_many :Cs B has_many :Cs C belongs_to A and B I got a single object of A and an array of B objects. How can I get all Cs that have a_id equal to object A.id *and* b_id that belongs to an object in Bs array? Regards --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2007 Apr 25
2
form_remote_for, reloaded
Hi, being relativly new to RoR, I''m having a problem which I found described in this forum and somewhere else - but with no solution. I know, that it may be bad to mix table and form tags, but the first solution of an in place editing within a table looked nice: Version using form_for: <tr> <%form_for :time_record, :url => { :action => "add_time_record" } do
2006 Apr 16
2
Making requests in order
Hello all, This is an interesting problem I have been working on. What I have is a little multiuser project request tracking application. What happens is that I log in and create projects and assign people to the projects. Each project has steps associated with it, and the steps need to be done in a certain order. Now, I have to request that the assigned person perform each of the steps, and
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
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.
2006 Apr 25
4
Newbie - Grouping of items...
I''m trying to build a dashboard type page (similar in function to basecamp''s) where I can show the last 5 updated items from my 3 differing models, then grouped together by project. Solution ideas: (1) Is it best to create a log model where everytime I add or update another model (like messages, comments, lists etc) an enrty gets added to the log along with the project. I
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
2006 Jan 08
2
RoR AJAX select box update?
Hi, I want to update a select box depending on another selected option thru ajax. Heres how I do it # _form.rhtml <select id="budget_coordinator_id" name="budget[coordinator_id]" onchange="<%= remote_function(:update => "budget_project_number", :url => { :action => :get_projects }) %>"> <%=