Skip to content

Instantly share code, notes, and snippets.

@compactcode
Created October 5, 2013 04:53
Show Gist options
  • Save compactcode/6836813 to your computer and use it in GitHub Desktop.
Save compactcode/6836813 to your computer and use it in GitHub Desktop.
Whats a good way to ensure that that the user assign to a site belongs to the same account?
class Site < ActiveRecord::Base
belongs_to :account
belongs_to :user
end
class User < ActiveRecord::Base
belongs_to :account
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment