gitlab-org--gitlab-foss/app
blackst0ne c57cddf5b9 [Rails5] Update Event#subclass_from_attributes method
In Rails 5.0 the `ActiveRecord::Inheritance::subclass_from_attributes`
method was updated.
Now it calls the `find_sti_class` method [1] which is overriden in the `Event`
model and returns needed class (`Event` vs `PushEvent`).

[1]: https://github.com/rails/rails/blob/5-0-stable/activerecord/lib/active_record/inheritance.rb#L209

This commit fixes the errors like
```
143) User#contributed_projects doesn't include IDs for unrelated projects
      Failure/Error: action = attrs.with_indifferent_access[inheritance_column].to_i

      NoMethodError:
        undefined method `with_indifferent_access' for nil:NilClass
      # ./app/models/event.rb:118:in `subclass_from_attributes'
```
which are raised on the `RAILS5=1 rspec ...` command.
2018-04-11 22:16:59 +11:00
..
assets Update state request from vue resource to axios 2018-04-10 16:30:49 +01:00
controllers [Rails5] Fix admin/application_settings_controller 2018-04-11 12:33:11 +11:00
finders Reduce complexity of issuable finder query. 2018-04-09 18:49:08 +02:00
helpers Projects and groups badges settings UI 2018-04-08 10:20:05 +00:00
mailers Fix body of email when commits are pushed to an MR 2018-04-03 13:22:25 +01:00
models [Rails5] Update Event#subclass_from_attributes method 2018-04-11 22:16:59 +11:00
policies Support Deploy Tokens properly without hacking abilities 2018-04-06 21:20:16 -05:00
presenters Removes deploy tokens presenter 2018-04-06 21:20:17 -05:00
serializers Resolve "Show failure_reason and upgrade tooltips of jobs" 2018-04-05 21:04:42 +00:00
services Revert "Merge branch 'improve-jobs-queuing-time-metric' into 'master'" 2018-04-10 10:41:08 +00:00
uploaders Add direct_upload setting for artifacts 2018-04-05 15:01:14 +02:00
validators Rename allow_private_networks to allow_local_network 2018-04-02 17:24:19 +02:00
views Merge branch 'sh-fix-issue-45152' into 'master' 2018-04-09 08:20:28 +00:00
workers Work around Ruby 2.3.7 bug by defining prepended class methods needed for tests 2018-04-09 06:46:33 -07:00