Created
December 22, 2010 02:17
-
-
Save jonhoman/750977 to your computer and use it in GitHub Desktop.
Why the inconsistent API?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Company < ActiveRecord::Base | |
has_many :employees | |
end | |
class Employee < ActiveRecord::Base | |
has_one :position | |
belongs_to :company | |
end | |
class Position < ActiveRecord::Base | |
belongs_to :employee | |
end | |
======================================= | |
# time to build mulit-model form | |
company.employees.build | |
employee.build_position | |
# why the inconsistent API??? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment