Skip to content

Commit

Permalink
order venues alphabetical
Browse files Browse the repository at this point in the history
  • Loading branch information
branch14 committed Mar 23, 2017
1 parent 9b72c41 commit cf5bb69
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/models/venue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'") }
Expand Down
2 changes: 1 addition & 1 deletion app/views/venues/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
%button.close-button{'data-close' => ''}
%span.float-right &times;
%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}
Expand Down

0 comments on commit cf5bb69

Please sign in to comment.