forked from jqr/has_one_autocreate
-
Notifications
You must be signed in to change notification settings - Fork 0
sneakin/has_one_autocreate
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Has One Autocreate ================== Automatic creation of a has_one associated object when it is first accessed. Examples ======== class User < ActiveRecord::Base has_one :profile, :autocreate => true end class Profile < ActiveRecord::Base belongs_to :user end # make a single user >> user = User.create(:name => 'Dr. User') => #<User id: 1, name: "Dr. User"> # look for any profile objects >> Profile.count => 0 # access the user's profile object to see it automatically created >> user.profile => #<Profile id: 1, title: nil, user_id: 1> Install ======= ./script/plugin install git://github.com/jqr/has_one_autocreate.git Homepage: http://github.com/jqr/has_one_autocreate/tree/master Copyright (c) 2008 Elijah Miller <elijah.miller@gmail.com>, released under the MIT license.
About
Automatic creation and building for has_one relationships
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- Ruby 100.0%