lib/cantango/api/session/account.rb
def any_account *types
        types = types.flatten.select_labels.map(&:to_sym)
        types = types & ::CanTango.config.accounts.registered
        accounts = types.map do |type|
          meth = :"current_#{type}_account"
          send(meth) if respond_to?(meth) && (types.empty? || types.include?(type))
        end
        chosen_account = accounts.compact.first
        chosen_account || guest_account
      end
# 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_account *types
        types = types.flatten.select_labels.map(&:to_sym)
        types = types & ::CanTango.config.accounts.registered
        accounts = types.map do |type|
          meth = :"current_#{type}_account"
          send(meth) if respond_to?(meth) && (types.empty? || types.include?(type))
        end
        chosen_account = accounts.compact.first
        chosen_account || guest_account
      end
def any_account * types types = types . flatten . select_labels . map ( & :to_sym ) types = types & :: CanTango . config . accounts . registered accounts = types . map do | type | meth = :" current_ #{ type } _account " send ( meth ) if respond_to? ( meth ) && ( types . empty? || types . include? ( type ) ) end chosen_account = accounts . compact . first chosen_account || guest_account end
give me any logged in user or the guest user
give me any logged in user or the guest user
types