Export only this year's talk preferences
This commit is contained in:
parent
9cbb51456c
commit
5e83ea8b3c
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue