Sha256: 9a514bc489d9641c656bdb060ea15a3770d40ceb03643d6333e4bf31fa332def

Contents?: true

Size: 334 Bytes

Versions: 11

Compression:

Stored size: 334 Bytes

Contents

class Trestle::DashboardController < Trestle::ApplicationController
  def index
    admin = primary_admin
    redirect_to admin.path if admin
  end

private
  def primary_admin
    if navigation = Trestle.navigation.first
      navigation.admin
    elsif Trestle.admins.values.any?
      Trestle.admins.values.first
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
trestle-0.8.11 app/controllers/trestle/dashboard_controller.rb
trestle-0.8.10 app/controllers/trestle/dashboard_controller.rb
trestle-0.8.9 app/controllers/trestle/dashboard_controller.rb
trestle-0.8.8 app/controllers/trestle/dashboard_controller.rb
trestle-0.8.7 app/controllers/trestle/dashboard_controller.rb
trestle-0.8.6 app/controllers/trestle/dashboard_controller.rb
trestle-0.8.5 app/controllers/trestle/dashboard_controller.rb
trestle-0.8.4 app/controllers/trestle/dashboard_controller.rb
trestle-0.8.3 app/controllers/trestle/dashboard_controller.rb
trestle-0.8.2 app/controllers/trestle/dashboard_controller.rb
trestle-0.8.0 app/controllers/trestle/dashboard_controller.rb