osem-fcy/app/models
Andrew Kvalheim b565be2f46 Correct assumption of survey start and end dates
The logic used for the `:reply` ability incompletely duplicated that of
`Survey#active?` and incorrectly assumed that surveys always have start
and end dates.

Resolves:

    Failures:

      1) Survey as an attendee respond to a survey during registration
         Failure/Error: survey.start_date > Time.current || survey.end_date < Time.current

         ActionView::Template::Error:
           undefined method `>' for nil:NilClass

                 survey.start_date > Time.current || survey.end_date < Time.current
                                   ^
         # ./app/models/ability.rb:126:in `block in signed_in'
         # ./app/views/surveys/show.html.haml:28:in `block in _app_views_surveys_show_html_haml___3404959267043700678_138180'
         # ./app/views/surveys/show.html.haml:19:in `_app_views_surveys_show_html_haml___3404959267043700678_138180'

    Failed examples:

    rspec ./spec/features/surveys_spec.rb:37 # Survey as an attendee respond to a survey during registration
2022-03-16 14:12:01 -07:00
..
concerns Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
.gitkeep First checkin 2013-01-07 09:04:09 +01:00
.lodging.rb.swp Use url instead object in image_tag 2019-07-17 00:13:24 +02:00
ability.rb Correct assumption of survey start and end dates 2022-03-16 14:12:01 -07:00
admin_ability.rb Grant conference organizers permission to manage surveys 2022-03-16 13:37:00 -07:00
answer.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
application_record.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
booth.rb Rubocop autocorrections 2018-11-16 09:06:05 -08:00
booth_request.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
cfp.rb Adopt more specs to the shoulda-matchers update 2019-02-19 20:50:09 +01:00
comment.rb Rubocop autocorrections 2018-11-16 09:06:05 -08:00
commercial.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
conference.rb Fix HasManyThroughOrderErrors 2022-02-23 14:36:05 +01:00
contact.rb Rubocop autocorrections 2018-11-16 09:06:05 -08:00
difficulty_level.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
email_settings.rb Rubocop autocorrections 2018-11-16 09:06:05 -08:00
event.rb Include helper that provides number_with_precision 2021-08-18 15:36:54 +02:00
event_schedule.rb Rubocop autocorrections 2018-11-16 09:06:05 -08:00
event_type.rb Rubocop autocorrections 2018-11-16 09:06:05 -08:00
event_user.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
events_registration.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
lodging.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
openid.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
organization.rb Rubocop autocorrections 2018-11-16 09:06:05 -08:00
payment.rb Rubocop autocorrections 2018-11-16 09:06:05 -08:00
physical_ticket.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
program.rb 👋 update_attributes 2022-02-23 14:36:05 +01:00
qanswer.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
question.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
question_type.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
registration.rb Remove travel schedule from registration 2021-03-06 04:09:02 +01:00
registration_period.rb Use Ruby safe navigation over Rails try 2018-06-01 09:15:57 -07:00
resource.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
role.rb Drop halt_callback_chains_on_return_false 2019-05-05 09:40:49 +02:00
room.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
schedule.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
splashpage.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
sponsor.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
sponsorship_level.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
subscription.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
survey.rb Correct assumption of survey start and end dates 2022-03-16 14:12:01 -07:00
survey_question.rb Fix JS error when saving survey_question 2021-03-07 07:32:52 +02:00
survey_reply.rb Add more options for surveys 2018-07-03 08:46:15 +03:00
survey_submission.rb Add more options for surveys 2018-07-03 08:46:15 +03:00
ticket.rb Enable registration to proceed without requiring a ticket. 2019-02-16 00:53:40 +01:00
ticket_purchase.rb 👋 update_attributes 2022-02-23 14:36:05 +01:00
ticket_scanning.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
track.rb Change initial state to new 2019-02-15 17:09:03 +01:00
user.rb Fix bug in which role assignments aren’t tracked in version history 2022-03-06 23:38:42 -08:00
users_role.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
vchoice.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
vday.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00
venue.rb Update venue country name for Countries 4.2 2022-03-06 23:05:29 -08:00
vote.rb Add uniqueness tests for Event scope on Vote model with User association 2020-05-19 22:24:37 -04:00
vposition.rb Add frozen_string_literal magic comment 2018-05-09 06:54:26 -07:00