Skip to content

Instantly share code, notes, and snippets.

@eguneys
Created November 22, 2014 20:01
Show Gist options
  • Save eguneys/be8447decf8da23013c3 to your computer and use it in GitHub Desktop.
Save eguneys/be8447decf8da23013c3 to your computer and use it in GitHub Desktop.
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