Displaying 6 results from an estimated 6 matches for "from_id".
Did you mean:
from_did
2005 Mar 04
3
optimization
...mSkill Load (0.094000) [1;37mSELECT * FROM skills WHERE
name = ''SQL''
[4;35mPerson Load (0.203000) [0;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;33mPerson Load (0.141000) [1;37mSELECT people.* FROM
people JOIN relations ON relations.to_id = people.id WHERE
relations.from_id = 1 AND (relations.relationship = ''romantic'' OR
relations.relationship = ''friend'')
[4;35mPerson Load (0.140000) [0;37mSELECT people.* FROM
people JOIN relations ON relations.to_id = people.id WHERE
relations.from_id = 1 AND (relations.relationship = ''...
2007 Jan 03
3
Self-referential habtm with condition is broken
Here''s a simplistic model class.
class Person < ActiveRecord::Base
has_and_belongs_to_many :relatives,
:class_name => ''Person'', :join_table => ''relatives'',
:foreign_key => ''from_id'', :association_foreign_key => ''to_id''
has_and_belongs_to_many :brothers,
:class_name => ''Person'', :join_table => ''relatives'',
:foreign_key => ''from_id'', :association_foreign_key => '...
2008 Jul 10
7
Showing another controllers action
If I am in controller A and I want to show the index of controller B,
how would I do that?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To
2006 Aug 14
1
2 foreign keys to one table
Hi,
I have a messaging class that has to relationships to one table
belongs_to :user, :foreign_key => "from_id"
belongs_to :user, :foreign_key => "to_id"
At the min I can specify message.user.login and it will return the
username of last relationship to that table.
how can I get it to bring back both references
ie message.from.login and message.to.login
thanks
scott
--
Posted via http...
2005 Dec 19
4
need some help designing my messaging system
...a
hard time designing my db. This is what i have in mind, but I am not
sure if its the best approach.
user has_one inbox
user has_one outbox
inbox has_many messages
outbox has_many messages
inbox table
user_id
outbox table
user_id
messages table
box_id (refers to either inbox or outbox - how?)
from_id
to_id
msg_status (new, sent, read, deleted, etc.)
subject
body
does this make sense? is there a better way of acheiving this? since
both inbox and outbox both have many messages, how do I created the
association between them? will the addition of a from_id and to_id in
my messages table slow anyth...
2007 Dec 13
16
"Tricks" for testing after_create callback???
I''ve got a model Message, which needs to send an email using action
mailer after it''s first saved in the database.
I want to pass the model to the mailer which then uses methods on the
message model to render the email.
So the natural way to do this is in an after_create callback on the
Message model.
But I can''t see an easy way to test this. Here''s my spec