| Class | Her::Model::Associations::HasOneAssociation |
| In: |
lib/her/model/associations/has_one_association.rb
|
| Parent: | Association |
Initialize a new object with a foreign key to the parent
@example
class User
include Her::Model
has_one :role
end
class Role
include Her::Model
end
user = User.find(1)
new_role = user.role.build(:title => "moderator")
new_role # => #<Role user_id=1 title="moderator">