search for: foreign_id

Displaying 5 results from an estimated 5 matches for "foreign_id".

2005 Dec 30
5
HABTM with finder_sql problem (Rails bug?)
I''m building an app that needs i18n support across the entire database (i.e. localized attributes). In order to do this I''ve created a special HABTM join table that can be associated with _any_ other table: create table language_strings ( for_table varchar(255) not null, foreign_id int not null, language_id varchar(5) not null, attr_name varchar(255) not null, value text not null, primary key (for_table, foreign_id, language_id) ); Notice the for_table and foreign_id columns. These two are used to identify the table and row to which each record belongs. To make this...
2006 Feb 09
30
why there is no automatic relationship discovery
When I explain RoR to someone I don''t have a convincing argument that explains why everything is so automatic and transparent, but relationships have to be encoded by hand in models. That shows I don''t understand well that part of AR. There''s the argument that says that not all databases offer metadata about foreign keys, but the natural question then is that,
2005 Nov 02
4
acts_as_metadata?
...roperty( id int not null primary key auto_increment, ar_class varchar(255), -- AR class this property extends property_name varchar(255), property_type text -- MySQL or Ruby type ); CREATE TABLE property_value( id int not null primary key auto_increment, foreign_id int not null, -- PK of the referenced object property_id int not null, -- Property has_many :property_values, PropertyValue belongs_to :property property_value text not null -- YAML-serialized (serialize :property_value) ); so that for our example, we would have: INSERT INTO p...
2006 Mar 07
13
Active Record - Can''t figure out relationship.
I have the following two tables: create table teams ( id int not null auto_increment, short_name varchar(12) not null, long_name varchar(50) not null, logo varchar(20) not null, primary key (id) ); create table rounds ( id int not null auto_increment, home_team_id int not null, away_team_id int
2006 Jul 08
2
Creating/Saving dependent objects
Folks, Am new to RoR and am building an example to get myself familiar. I am running into a simple issue while creating a user registration page. I have a User and Address models defined as below (partial/relevant code included below). User has_one address and Address belongs_to user. I have a foreign key defined in address table that refers to user(id) In a form I take in username, password,