search for: fooid

Displaying 2 results from an estimated 2 matches for "fooid".

Did you mean: food
2006 Jan 03
4
Set the foreign key constraint column name?
...will let me go in and rename things. So I need to discover the limits of what I can change with Rails. I''ve found set_table_name and set_primary_key, which have been very useful. If I have a "foo has_one :bar" relationship, but then in the bar table my column is named "fooid" or some other thing that is not "foo_id", is there a similar helper command I can use to change it? Everything''s working swimmingly for me, except when I get to this bit and it errors out telling me "cannot find bar.foo_id" and I can''t figure out a wa...
2005 Jan 28
16
primary_key_prefix_type, support for non-integer primary keys
..._key_prefix_type and non-integer primary keys. I see in the ActiveRecord documentation [1] that by default the primary key of a table "foo" is expected to be "id", though primary_key_prefix_type this can be changed to :table_name or :table_name_with_underscore for "fooid" and "foo_id" respectively. I''m unclear where to set this or the syntax I should use. My attempt has been to add code to environment.rb things such as ActiveRecord::Base.primary_key_prefix_type :table_name_with_underscore or def ActiveRecord::Base.primary_key_pre...