Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ручная сортировка типов событий

  • Loading branch information...
commit 8be8632a9c40c93839d7da642c5603316709b5fd 1 parent 1ef2219
@lda lda authored
View
4 app/models/affiches/affiche.rb
@@ -27,6 +27,10 @@ class Affiche < ActiveRecord::Base
time :last_showing_time
end
+ def self.descendants
+ [Movie, Concert, Party, Spectacle, Exhibition, SportsEvent, Other]
+ end
+
def showings_grouped_by_day(search_params = nil)
search_params ||= { :starts_on_gt => Date.today, :starts_on_lt => Date.today + 4.weeks }
showing_ids = ShowingSearch.new(search_params).result_ids
View
2  app/views/application/main_page.html.erb
@@ -4,7 +4,7 @@
<h3><a href='/affiches' class='solid_dark_gray'>Афиша</a></h3>
<div class="category">
<ul>
- <% Affiche.descendants.map(&:model_name).sort.each do |klass| %>
+ <% Affiche.descendants.map(&:model_name).each do |klass| %>
<li>
<%= link_to klass.human, "/affiches/##{klass.underscore}", :class => 'solid_light_blue' %>
</li>
View
2  app/views/layouts/public.html.erb
@@ -43,7 +43,7 @@
<div class="right">
<h5><a href='#' class='dashed_light_blue'><%= t('affiche') %></a></h5>
<ul>
- <% Affiche.descendants.map(&:model_name).sort.each do |klass| %>
+ <% Affiche.descendants.map(&:model_name).each do |klass| %>
<li>
<%= link_to klass.human, "/affiches/##{klass.underscore}", :class => 'solid_dark_gray' %>
</li>
Please sign in to comment.
Something went wrong with that request. Please try again.