diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 8f61789..7d1be76 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -9,8 +9,7 @@ class HomeController < ApplicationController end def export - @talks = Talk.find(:all, from: :halfnarp_friendly) - @talk_preferences = TalkPreference.all + @talk_preferences = TalkPreference.this_years end def conflicts diff --git a/app/models/talk_preference.rb b/app/models/talk_preference.rb index fe68f93..957d595 100644 --- a/app/models/talk_preference.rb +++ b/app/models/talk_preference.rb @@ -13,6 +13,11 @@ class TalkPreference < ActiveRecord::Base ids.all? { |id| include? id } end + def self.this_years + timespan = Time.now.change(month: 1, day: 1, hour: 0)..Time.now.change(month: 12, day: 1, hour: 0) + where created_at: timespan + end + private def assign_new_unique_id