Skip to content

Instantly share code, notes, and snippets.

@jonhoman
Created December 22, 2010 02:17
Show Gist options
  • Save jonhoman/750977 to your computer and use it in GitHub Desktop.
Save jonhoman/750977 to your computer and use it in GitHub Desktop.
Why the inconsistent API?
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