[Bugfix] Conference methods related to weeks now database independent

This commit is contained in:
Chrisbr 2014-06-25 14:58:33 +02:00
parent fd95570c02
commit 596027e49b
6 changed files with 55 additions and 4 deletions

View file

@ -34,7 +34,16 @@ class Registration < ActiveRecord::Base
alias_attribute :other_needs, :other_special_needs
after_create :set_week
def week
created_at.strftime('%W').to_i
end
private
def set_week
self.week = created_at.strftime('%W')
save!
end
end