Module: Padlock::ActiveRecord

Defined in:
lib/padlock/integrations/active_record.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_padlock_user(opts = {}) ⇒ Object



3
4
5
6
7
8
# File 'lib/padlock/integrations/active_record.rb', line 3

def acts_as_padlock_user(opts={})
  Padlock.config.user_class_name  = self.name
  Padlock.config.user_foreign_key = opts[:foreign_key] if opts[:foreign_key].present?

  class_eval { include Padlock::User }
end