Use shorter map() syntax

This commit is contained in:
Vinnie Okada 2015-02-15 20:50:53 -07:00
parent 9e0467c38e
commit e0f61a59b4
2 changed files with 2 additions and 4 deletions

View file

@ -16,9 +16,7 @@ class ProfilesController < ApplicationController
def applications
@applications = current_user.oauth_applications
@authorized_tokens = current_user.oauth_authorized_tokens
@authorized_apps = @authorized_tokens.map do |token|
token.application
end.uniq
@authorized_apps = @authorized_tokens.map(&:application).uniq
end
def update

View file

@ -17,6 +17,6 @@
%tr{:id => "application_#{application.id}"}
%td= link_to application.name, admin_application_path(application)
%td= application.redirect_uri
%td= application.access_tokens.map { |t| t.resource_owner_id }.uniq.count
%td= application.access_tokens.map(&:resource_owner_id).uniq.count
%td= link_to 'Edit', edit_admin_application_path(application), class: 'btn btn-link'
%td= render 'delete_form', application: application