lib/cantango/api/session/user.rb
# give me any logged in user or the guest user
give me any logged in user or the guest user
give me any logged in user or the guest user
def any_user *types
        types = types.flatten.select_labels.map(&:to_sym)
        types = types & ::CanTango.config.users.registered
        users = types.map do |type|
          meth = :"current_#{type}"
          send(meth) if respond_to?(meth) && (types.empty? || types.include?(type))
        end
        chosen_user = users.compact.first
        chosen_user || guest_user
      end
def any_user * types types = types . flatten . select_labels . map ( & :to_sym ) types = types & :: CanTango . config . users . registered users = types . map do | type | meth = :" current_ #{ type } " send ( meth ) if respond_to? ( meth ) && ( types . empty? || types . include? ( type ) ) end chosen_user = users . compact . first chosen_user || guest_user end
give me any logged in user or the guest user
give me any logged in user or the guest user
types