Displaying 6 results from an estimated 6 matches for "organisation_id".
2009 Oct 29
4
Unknown column 'quotes.organisation_id' in 'where clause': SELECT * FROM `quotes` WHERE (`quotes`.organisation_id = 1036)
...gs_to :customer, :class_name => ''Organisation''" and
"belongs_to :end_user, :class_name => ''Organisation''".
I now want to get all quotes for a given organisation. If I do
Organisation.find(1).quotes I get:
Unknown column ''quotes.organisation_id'' in ''where clause'': SELECT * FROM
`quotes` WHERE (`quotes`.organisation_id = 1)
So I end up doing:
@quotes = []
@org = Organisation.find(1)
Quote.find(:all, :conditions=>["customer_id = ? OR end_user_id = ?",
@org.id, @org.id]).each {|q| @quo...
2006 Jun 08
9
find :order =>
Hi,
I have the following find statment
@client_pages, @clients = paginate :clients, :per_page => 20, :order =>
"organisation_id, surname"
currently im ordering by organisation_id however I need to order by the
field in the organisation table organisations.name
how can this be done?
Thanks
Scott
--
Posted via http://www.ruby-forum.com/.
2006 Jun 27
1
find (ordering by field in related table)
Hi,
I am using the rails find command as below
@project_pages, @projects = paginate :projects, :per_page => 20,
:conditions => "clients.organisation_id = " +
params[''search''][''organisation_id''],
:joins => ''inner join clients ON clients.id = projects.client_id''
There seems to be a problem with project.id being over written with
project.client.id.
Any suggestions to whats going wrong?...
2006 Jan 06
6
NewbieQ: How do I refresh view after return from popup window
...organisation.png", :alt => ''New'',
:border =>1),
{ :controller => ''organisations'', :action => ''new''},
:popup => [''new_window'', ''height=100,width=100'']) %>
<select id="person.organisation_id" name="person[organisation_id]">
<%= options_from_collection_for_select @org,
"id", "organisation_name", @person.organisation_id %> </select></p>
</td>
2006 Apr 26
6
get foreign key table data
Hi
I?m trying to bring across all related data.
My table clients has a foreign key field that stores the id of an
organization
How can I grab the details of the organization to use in the clients
show.rhtml file?
Thanks
Scott
--
Posted via http://www.ruby-forum.com/.
2005 Mar 30
0
Help - dependencies.rb - `const_missing': uninitialized constant
...t this has_and_belongs_to_many join to work (re: my
post from yesterday). I''m getting an error I can''t seem to get by.
Help?
I now have the following tables:
ORGANISATIONS:
id (primary key)
name
REPRESENTATIVES
id (primary key)
name
ORGANISATIONS_REPRESENTATIVES
organisation_id
representative_id
My models are:
class Organisation < ActiveRecord::Base
has_and_belongs_to_many :representatives
end
class Representative < ActiveRecord::Base
has_and_belongs_to_many :organisations
end
In organisations_helper.rb I have:
module OrganisationsHelper
def reps_list(or...