Created
November 22, 2014 20:01
-
-
Save eguneys/be8447decf8da23013c3 to your computer and use it in GitHub Desktop.
This file contains 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 Account < ActiveRecord::Base | |
end | |
class Partner < ActiveRecord::Base | |
has_many :accounts | |
def add_account(attributes) | |
accounts.create!(attributes) do |r| | |
r.partner_id = id | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment