Module: CanTango::Macros::User

Defined in:
lib/cantango/masquerade_ext/macros/user.rb

Instance Method Summary collapse

Instance Method Details

#tango_user(options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/cantango/masquerade_ext/macros/user.rb', line 3

def tango_user options = {}
  self.send :include, CanTango::Api::Model::User
  options = [options] if options.kind_of?(Symbol)
  options = CanTango::Macros.extract(options) if options.kind_of? Array

  if defined? CanTango::Macros::Masquerader::User
    self.send :include, CanTango::Macros::Masquerader::User
    masquerader if options[:masquerade]
  end
end