Top "Belongs-to" questions

This is a master-detail relationship where one item "belongs_to" another and has a foreign key to maintain the relationship.

ExtJS 4: Understanding hasMany and belongsTo

I've been struggling to understand how to use hasMany and belongsTo for quite sometime. My understanding is hasMany is a 1:…

model extjs4 has-many extjs4.2 belongs-to
rails creating model with multiple belongs_to, with attr_accessible

My models look something like this: class User < ActiveRecord::Base attr_accessible: :name has_many :reviews end class Product &…

ruby-on-rails belongs-to
Rails: has_one and belongs_to with presence validation on both foreign keys

I have an application with a users table and a user_profiles table. A user has_one user profile and …

ruby-on-rails associations belongs-to has-one
belongs_to with a custom class_name not producing proper foreign key in Rails 3

I am updating an application to Rails 3 and I am having trouble creating a custom foreign key. I have something …

ruby-on-rails activerecord belongs-to
Rails has_one and belongs_to migration?

I'm trying to establish a relationship between two models in Rails but I am having trouble figuring out what I …

ruby-on-rails migration belongs-to has-one
CakePHP: few joins, belongsTo and hasMany relations done in two queries

I need some help with CakePHP 2.2.3. What I have I have the following setup at the moment: Post hasMany Attachment …

php mysql cakephp has-many belongs-to
referencing attributes in models with belongs_to relationships through a nested namespace

Ok, so I thought I understood how the relationship specifications work in rails but I've been struggling with this for …

ruby-on-rails-3 belongs-to