When running migration 20170705075039 followed by 20170715131706, the
latter fails due to lingering null values in a newly non-null column—
Mysql2::Error: Invalid use of NULL value: ALTER TABLE `tracks` CHANGE `state` `state` varchar(255) DEFAULT 'new' NOT NULL
db/migrate/20170715131706_make_track_state_not_null_and_add_default_value.rb:17:in `change'
—despite having apparently converted any existing null values prior to
changing the column type. Investigation reveals that actually the
attempted conversion has had no effect, and that this can be resolved by
clearing ActiveRecord internal caches between migrations:
connection.schema_cache.clear_data_source_cache! 'tracks'
The same problem also affects running 20170705075039 followed by
20170720134353, but in that case it leads to silent data corruption as
`change_column_null` automatically converts any lingering null values.
This commit 1) clears ActiveRecord internal caches at the beginning of
each affected migration, and 2) replaces `change_column_null` with
`change_column` to reflect that no automatic conversion is intended.
CarrierWave documentation:
> Note: `recreate_versions!` will throw an exception on records without
> an image. To avoid this, scope the records to those with images or
> check if an image exists within the block.
Resolves#1976:
NoMethodError: undefined method `read' for nil:NilClass
…/carrierwave-1.3.1/lib/carrierwave/uploader/cache.rb:81:in `sanitized_file'
…/carrierwave-1.3.1/lib/carrierwave/uploader/cache.rb:118:in `cache!'
…/carrierwave-1.3.1/lib/carrierwave/uploader/versions.rb:234:in `recreate_versions!'
db/migrate/20171130172334_rebuild_conference_pictures.rb:4:in `block in up'
Many migrations currently fail to run with:
> Directly inheriting from ActiveRecord::Migration is not supported.
> Please specify the Rails release the migration was written for:
>
> class Example < ActiveRecord::Migration[4.2]
I've annotated those that I need to run with the Rails version at the
time each was committed:
rake db:migrate:status \
| grep --perl-regexp --only-matching '(?<=^ down )\d{14}' \
| while read -r id; do
path="$(ls -1 db/migrate/${id}_*.rb)"
version="$(git show "$(git log --diff-filter=A --pretty=format:%H -- "$path")":Gemfile.lock \
| grep --perl-regexp --only-matching '(?<=^ rails \()\d+\.\d+(?=(\.\d+)+\))')"
sed --in-place -e "s/\(< ActiveRecord::Migration\)$/\\1[$version]/" "$path"
done
* Survey period constraints
* Add abilities
* Enforce required questions
* Update survey_submssion updated_at
* Do a full match of possible answer and user reply
values.each and keys.each methods are depreciated, so they have replaced by
each_value and each_key respectively. This has done manually.
Closes https://github.com/openSUSE/osem/issues/1825
To show scheduled events that have been cancelled/withdrawn as 'cancelled', and consequently also show when an event is their replacement.
admin/schedules#show does not show events that were scheduled and then cancelled/withdrawn, however a record in event_schedules exists for those events, but event_schedule.enabled = false
Update config with rails app:update
Update schema.rb rails db:migrate
Add puma
Make jobs and models inherit from ApplicationJob and ApplicationRecord
Update acts_as_list to 0.9.7 in order to fix
"undefined method `sanitize_sql_hash_for_conditions'" error
Update web-console to 2.3.0 to fix a 500 internal server error
Replace before_filter with before_action
Add rails-controller-testing gem
Add prepend: :true to protect_from_forgery in ApplicationController to
avoid ActionController::InvalidAuthenticityToken exceptions
Remove activeuuid
Update formtastic to 3.1.5 to fix deprecation warnings and issues
with the Input class
Update ahoy_matey to 1.6.0
Update cancancan to 2.0.0 to fix issues with malformed sql queries
Fix program spec
Fix issue with the picture being nil in admin/Organizations#new and #edit
and Organizations#show
Fix ActiveRecord::Base.raise_in_transactional_callbacks= deprecation
warning by removing an unnecessary line in application.rb
Fix failing versions specs
closes#1650
done some changes
minor changes
added markdown format to cfp#show
fixed description text position in proposals
fixed truncated description text in show action
minor changes on non-admin side
Amount paid colum is added to ticket purchase to keep the record of money paid by the user.
It is added to physical_ticket#index to show admin, price paid by each user for each ticket.
Add track association to schedule
Show schedules in admin sidebar to track organizers
Allow track organizers to manage the schedules of their tracks
Don't allow self-organized track events to be dragged or unscheduled in
a conference schedule
Make scheduled events of self-organized tracks appear semitransparent in
conference schedules
Make the rooms of confirmed self_organized tracks appear semitransparent
and don't allow events to be scheduled to it in the conference schedules
during the dates of its track
Create admin/SchedulesController#new action
Add a button in admin/Schedules#index to create schedules for tracks
Add self_organized scope to Track
Modify Schedules#show to handle track schedules and show a unified
schedule
Allow track organizers to create new schedules for their tracks
Correctly identify scheduled and unscheduled events in Schedules#events
Fix Event#room and Event#time for when the event is scheduled in a track
schedule
Modify Program#selected_event_schedules to include the event_schedules
of selected track schedules
Modify Track#revoke_role_and_cleanup to destroy the track's schedules
and revert its events' state to new
Add tabs for conference and track schedules in admin/Schedules#index
Add button to Create/Show a tracks schedule in Tracks#index and #show
Fix concurrent_events in application_helper because of changes in
Program#selected_event_schedules
Do not take into account cfp_active in Event#valid_track
Modify EventsController#get_tracks accordingly
Enforce cfp_active of track to be enabled for proposals in
ProposalsController#create and #update
Add support for multiple schedules per track
Add selected_schedule_id to Track
Load EventSchedules of selected track schedules for conference schedules
in admin/SchedulesController#show
Modify SchedulesController#show to take into account only the selected
track schedules
Create Event#selected_schedule_id and use it in Event#scheduled? and
Event#time
Validate that an EventSchedule for an event of a self-organized track
belongs to one of the track's schedules
Add 'Manage' button in Tracks#index, #show that sends you to the admin
side of things
Add admin/TracksController#update_selected_schedule to update the
selected_schedule_id of tracks
Allow track submitter to request specific dates
Redirect to Tracks#edit if a track doesn't have a room or start/end date
before accepting it
Don't allow the submitter or the track organizers to edit the request
after it has been accepted or confirmed
Restrict track selection in proposals and move track selection from
Proposals form to events helper
Mark cfp_active of the tracks table as not null and fill in true if nil