We are using `paper_trail` gem, which saves data in database table
versions. It has a native way to search in the versions records,
using `where_object()` and `where_object_changes()`. They are broken,
under certain conditions. We changed them to a manual `where()`.
To test this case we need: an Event with ID 1, an Event with ID 2, and
a commercial with ID 1, for event with ID 2 - obviously the numbers
could be different as long as there is this matching of IDs. Before
this was made wit ha expect, which would make the test fail if this is
not the case. But this is actually the test case, not what we want to
test, so I moved to the `let`.
This was also the case why one of the test was broken after we change
how the database is cleaned in:
https://github.com/openSUSE/osem/pull/1541
I also remove the feature test, as this should be tested in a
controller test.
There is a known issue in paper_trail that whenever we Query the
'versions.object' column it evaluates inconsistent results for numeric
values due to limitations of SQL wildcard matchers against the
serialized objects. So to fix this issue I have manually formed the where
query instead of using where_object and where_object_changes. I have
also added test for the same.
Fixes#1307
EventSchedule start time should be in hours range of the conference.Therefore it adds validation on start_time attribute of event schedule model. It also adds test for the same.
Remove the unreachable code from ConferenceRegistrationController#new
Rework the error message logic in ConferenceRegistrationController#new
Fix redirect to #edit when the user is registered
Refactor ConferenceRegistrationController#new spec and add more tests
Sets up paper_trail tracking in important models
and add conference_id to versions for storing conference_id
of conference related objects as metadata.This will help in querying
for versions related to conferences.
Fix issues with factories & event types initialization.Import paper_trail testing helpers
Fix bug: Creating an event creates a useless version with event update
Add revert and view changes features to revision history
- Drop selected_event_schedule function
- Rename scheduled_room and scheduled_start_time to room and time as if there is no selected_schedule, the event is not scheduled.
program.selected_schedule.event_schedules.order(start_time: :asc) was repeated several times and it has been moved to conference#selected_event_schedules