Top "Has-one" questions

Rails: Using build with a has_one association in rails

In this example, I create a user with no profile, then later on create a profile for that user. I …

ruby-on-rails associations has-one database-relations
Difference between has_one and belongs_to in Rails?

I am trying to understand has_one relationship in RoR. Let's say I have two models - Person and Cell: …

ruby-on-rails ruby has-one
Should I use has_one or belongs_to in ruby on rails?

I want to have a Status model which will be relatively static after some user-defined set up (and different users …

ruby-on-rails belongs-to has-one
where condition with HasOne laravel

In login model I have implement relation with picture table function picture () { return $this->hasOne('App\Picture'); } Now I …

laravel has-one
Cakephp: HasOne Relationship

I'm trying to model the following: A journey has an id, a fromCity and a toCity. My DB looks like …

cakephp has-one
Rails nested has_one: cannot delete existing record

I'm trying to update nested question_output attributes in a 'question' model. A question has_one question_output. If there …

ruby-on-rails nested-attributes has-one
CakePHP hasOne/belongsTo model relationship

I have a few models I'm trying to relate. One model is Item, one is Slide, and another is Asset. …

cakephp orm relationship belongs-to has-one
Rails: Create association if none is found to avoid nil errors

I have an application where my users can have a set of preferences. Both are stored as ActiveRecord-models as follows: …

ruby-on-rails activerecord has-one
Ruby on Rails - has_one relation, how to check if it has an existing association?

I have a simple problem, related to associations. I have a model for book, that has_one reservation. Reservation belongs_…

ruby-on-rails ruby has-one
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