Skip to content

Instantly share code, notes, and snippets.

@lscott3
Created May 17, 2012 01:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lscott3/2715572 to your computer and use it in GitHub Desktop.
Save lscott3/2715572 to your computer and use it in GitHub Desktop.
class Account < ActiveRecord::Base
has_many :users
authenticates_many :user_sessions, :scope_cookies => true
# Other code by you
end
class User < ActiveRecord::Base
belongs_to :account
acts_as_authentic do |c|
c.validations_scope = :account_id
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment