Module: CanTango::Users::User

Defined in:
lib/cantango/users/user.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#active_accountObject

include Masquerade



7
8
9
# File 'lib/cantango/users/user.rb', line 7

def 
  @active_account
end

Class Method Details

.included(base) ⇒ Object



25
26
27
# File 'lib/cantango/users/user.rb', line 25

def self.included(base)
  CanTango.config.users.register base.name.underscore.gsub(/_user$/, ''), base
end

Instance Method Details

#active_userObject



9
10
11
# File 'lib/cantango/users/user.rb', line 9

def active_user
  @active_user || self
end

#can?(*args) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/cantango/users/user.rb', line 13

def can? *args
  CanTango::Ability.new().can?(*args)
end

#cannot?(*args) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/cantango/users/user.rb', line 17

def cannot? *args
  CanTango::Ability.new().cannot?(*args)
end