Displaying 8 results from an estimated 8 matches for "manager_id".
Did you mean:
manager_
2005 Feb 09
1
cant map foreign key in list view
...ruggling to get a foreign key in a list map to a readable
value in a lookup table
I have a list of projects and each project has a project_manager.
Project.rb
class Project < ActiveRecord::Base
has_one :project_manager, :class_name => "Users", :foreign_key =>
"manager_id"
end
The association above sais that a project_manager is in fact just a
User. BTW what is the technical term for the project_manager object?
The Project DB table has a foreign key column called manager_id and the
Users table has a id column. Based on this Rails should be able to put...
2006 Feb 14
6
Multiple associations to the same class
Hi,
I cannot seem to create associations like this:
class Project < ActiveRecord::Base
belongs_to :manager, :class_name => ''User'', :foreign_key => ''manager''
belongs_to :liaison, :class_name => ''User'', :foreign_key => ''liaison''
end
p = Project.new
p.manager
=> 1
trying to retrieve associated objects
2006 Jul 06
4
Oracle HR on Rails
Interesting read...apologies if it has been posted already.
http://www.oracle.com/technology/pub/articles/saternos-rails.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060706/619e650a/attachment.html
2006 Feb 10
1
Eager loading issue
...r name. Theoretically, i''d like to be
able do an eager loading of both :project, and :manager. Right now,
my list generates an individual SQL query for each invoice to display
the manager name. Trying to do :include => [:project, :manager]
obviously doesn''t work, as the manager_id is linked into the Projects
table, not Invoices.
2006 Jan 09
3
Include with two references of one model of the same table
...uot;division_id" AS t1_r10, matches."hometeam_id" AS t1_r4, teams_seasons."coach_id" AS t0_r3, matches."division_id" AS t2_r10, matches."id" AS t2_r0, matches."played" AS t1_r11, matches."matchtime_start" AS t1_r5, teams_seasons."manager_id" AS t0_r4, matches."played" AS t2_r11, matches."matchtime_stop" AS t1_r6, teams_seasons."league_id" AS t0_r5 FROM teams_seasons LEFT OUTER JOIN matches ON matches.hometeam_id = teams_seasons.id LEFT OUTER JOIN matches ON matches.awayteam_id = teams_seasons.id WH...
2006 Feb 09
2
Crazy @55 Inheritance
I have one table, called "people".
Within this table, there are type "users", "managers".... etc. So, basic
STI.
Now, I want a "user" to have one manager, but a "manager" to have many
"users".
Since I don''t want to use HABTM... how do I set this relationship up seeing
that :has_one, :belongs_to and :has_many don''t
2009 Jul 21
1
synatx error while running migration
...end
/db/migrate/20090715172542_create_projects.rb
class CreateProjects < ActiveRecord::Migration
def self.connection
Project.connection
end
def self.up
create_table :projects do |t|
t.string :name
t.text :description
t.integer :manager_id
t.timestamps
end
end
def self.down
drop_table :projects
end
end
and one finale thing is that i have also setup many-to-many association
between Model of my main application and Model of my engine
i.e between User model of main applicatio...
2006 Sep 25
3
Subclasses - help required
...oject manger type of application, staff are assigned to projects,
but each staff has varied roles for different projects... STI does not
seem to be applicable here
Imagine a table staffs...
id int
name varchar
blah....
is_manager int 1
is_engineer int 1
is_producer int 1
and projects...
id
name
manager_id
engineer_id
producer_id
how is the best way to subclass manager, engineer, and producer from
class:staff??
cheers
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ru...