mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Simplify set_week callbacks
Changes to :week are already ignored py paper_trail. No need to wrap this in a `without_versioning`. Also drop the reader in `Registration` and the tests. Why write this into the DB but never read it again? Why test standard ruby/activerecord stuff.
This commit is contained in:
parent
f458736a39
commit
fb2612ecaf
3 changed files with 2 additions and 30 deletions
|
|
@ -317,10 +317,7 @@ class Event < ApplicationRecord
|
|||
end
|
||||
|
||||
def set_week
|
||||
self.week = created_at.strftime('%W')
|
||||
paper_trail.without_versioning do
|
||||
save!
|
||||
end
|
||||
update!(week: created_at.strftime('%W'))
|
||||
end
|
||||
|
||||
def before_end_of_conference
|
||||
|
|
|
|||
|
|
@ -46,10 +46,6 @@ class Registration < ApplicationRecord
|
|||
(conference.program.events.with_registration_open - events) + events
|
||||
end
|
||||
|
||||
def week
|
||||
created_at.strftime('%W').to_i
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
##
|
||||
|
|
@ -76,10 +72,7 @@ class Registration < ApplicationRecord
|
|||
end
|
||||
|
||||
def set_week
|
||||
self.week = created_at.strftime('%W')
|
||||
paper_trail.without_versioning do
|
||||
save!
|
||||
end
|
||||
update!(week: created_at.strftime('%W'))
|
||||
end
|
||||
|
||||
def registration_limit_not_exceed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue