diff --git a/app/models/venue.rb b/app/models/venue.rb index d05438494..7ccf9caa3 100644 --- a/app/models/venue.rb +++ b/app/models/venue.rb @@ -25,6 +25,8 @@ class Venue < ActiveRecord::Base include ActiveModel::Transitions + scope :ordered, -> { order('name ASC') } + scope :not_offline, -> { where.not(state: 'offline') } scope :with_live_talks, -> { joins(:talks).where("talks.state = 'live'") } diff --git a/app/views/venues/index.html.haml b/app/views/venues/index.html.haml index 8c91b50a6..15ab5c63c 100644 --- a/app/views/venues/index.html.haml +++ b/app/views/venues/index.html.haml @@ -22,7 +22,7 @@ %button.close-button{'data-close' => ''} %span.float-right × %p= s('.help_text') - - @venues.each do |venue| + - @venues.ordered.each do |venue| .talk-card.driftup.small-12.medium-3.large-4.columns = link_to venue do .talk-card-inside{class: venue.state}