gitlab-org--gitlab-foss/app/models
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
..
badges Projects and groups badges API 2018-03-05 17:51:40 +00:00
blob_viewer
ci Add cop for has_many :through without disabled autoloading 2018-04-09 12:47:04 +01:00
clusters Use Goldiloader for handling N+1 queries 2018-04-09 11:58:06 +01:00
concerns Use Goldiloader for handling N+1 queries 2018-04-09 11:58:06 +01:00
conversational_development_index
diff_viewer
hooks Merge branch 'jej/mattermost-notification-confidentiality-10-6' into 'security-10-6' 2018-04-05 08:41:56 +02:00
issue
members Don't delete todos or unassign issues and MRs when a user leaves a project 2018-03-07 17:18:01 -06:00
merge_request
network Fix Gitaly n+1 in NetworkController#show 2018-03-06 13:32:48 +00:00
project_services Merge branch 'jej/mattermost-notification-confidentiality-10-6' into 'security-10-6' 2018-04-05 08:41:56 +02:00
protected_branch
protected_tag
storage
.gitkeep
ability.rb Port read_cross_project ability from EE 2018-02-22 17:11:36 +01:00
abuse_report.rb
appearance.rb Use the GitLab version as part of the appearances cache key 2018-04-05 12:55:12 -07:00
application_setting.rb Merge branch 'fj-15329-services-callbacks-ssrf' into 'security-10-6' 2018-03-21 14:39:21 +00:00
audit_event.rb
award_emoji.rb
badge.rb Projects and groups badges API 2018-03-05 17:51:40 +00:00
blob.rb 26039 - update github-linguist to 5.3.3 version 2018-02-21 03:29:04 +10:30
board.rb Bring one group board to CE 2018-03-03 12:56:17 -03:00
broadcast_message.rb
chat_name.rb Expose ChatName objects to slash commands 2018-02-23 14:37:53 +01:00
chat_team.rb
commit.rb Add support for patch link extension for commit links on GFM 2018-04-06 12:53:14 -03:00
commit_collection.rb
commit_range.rb
commit_status.rb Revert "Allow CI/CD Jobs being grouped on version strings" 2018-04-04 14:10:22 +02:00
compare.rb Remove unused Compare#base_commit 2018-03-08 11:39:50 -03:00
container_repository.rb
cycle_analytics.rb Refactors median code to work with both single and multiple projects 2018-02-28 10:46:20 +00:00
dashboard_milestone.rb
deploy_key.rb Add cop for has_many :through without disabled autoloading 2018-04-09 12:47:04 +01:00
deploy_keys_project.rb Merge branch 'sh-migrate-can-push-to-deploy-keys-projects-10-3' into 'security-10-3' 2018-01-16 17:04:51 -08:00
deploy_token.rb Verify that deploy token has valid access when pulling container registry image 2018-04-10 07:31:30 +00:00
deployment.rb Deprecate InternalId concern and rename. 2018-03-16 13:35:25 +01:00
diff_discussion.rb
diff_note.rb
directly_addressed_user.rb
discussion.rb
discussion_note.rb
email.rb
environment.rb Fix environment deployment platform filter method 2018-04-06 12:10:30 +02:00
epic.rb
event.rb [Rails5] Update Event#subclass_from_attributes method 2018-04-11 22:16:59 +11:00
event_collection.rb
external_issue.rb Fix closing issues text added to MRs for external issue trackers 2018-02-14 14:58:28 +00:00
fork_network.rb Add cop for has_many :through without disabled autoloading 2018-04-09 12:47:04 +01:00
fork_network_member.rb
forked_project_link.rb
generic_commit_status.rb
global_label.rb
global_milestone.rb Merge branch 'milestones-finder-order-fix' into 'security-10-3' 2018-01-16 17:04:38 -08:00
gpg_key.rb
gpg_key_subkey.rb
gpg_signature.rb
group.rb Add cop for has_many :through without disabled autoloading 2018-04-09 12:47:04 +01:00
group_custom_attribute.rb
group_label.rb
group_milestone.rb
guest.rb
identity.rb Moved o_auth/saml/ldap modules under gitlab/auth 2018-02-28 16:53:02 +01:00
individual_note_discussion.rb
instance_configuration.rb
internal_id.rb Address review comments. 2018-03-16 13:35:27 +01:00
issue.rb Use Goldiloader for handling N+1 queries 2018-04-09 11:58:06 +01:00
issue_assignee.rb use Gitlab::UserSettings directly as a singleton instead of including/extending it 2018-02-02 18:39:55 +00:00
issue_collection.rb
key.rb Revert "Merge branch 'rd-43185-revert-sanitize-extra-blank-spaces-used-when-uploading-a-ssh-key' into 'master'" 2018-02-15 09:50:19 -05:00
label.rb Use Goldiloader for handling N+1 queries 2018-04-09 11:58:06 +01:00
label_link.rb
label_priority.rb
legacy_diff_discussion.rb
legacy_diff_note.rb
lfs_file_lock.rb Backport of LFS File Locking API 2018-02-07 09:04:00 -05:00
lfs_object.rb Add cop for has_many :through without disabled autoloading 2018-04-09 12:47:04 +01:00
lfs_objects_project.rb
list.rb
member.rb [Rails5] Rename sort methods to sort_by_attribute 2018-04-04 09:19:47 +00:00
merge_request.rb Fix N+1 in MergeRequest#merge_request_diff_for 2018-03-21 17:24:46 +00:00
merge_request_diff.rb Revert "Cleanup after adding MR diff's commit_count" 2018-03-08 12:43:14 +01:00
merge_request_diff_commit.rb [Rails5] Update type_cast_*_database methods 2018-04-06 10:57:19 +00:00
merge_request_diff_file.rb
merge_requests_closing_issues.rb
milestone.rb Add cop for has_many :through without disabled autoloading 2018-04-09 12:47:04 +01:00
namespace.rb Extend API for importing a project export with overwrite support 2018-04-06 15:23:49 +00:00
note.rb Merge branch 'jprovazn-comment-refs' into 'master' 2018-04-05 12:41:01 +00:00
notification_reason.rb Initial work to add notification reason to emails 2018-01-16 19:17:55 -06:00
notification_recipient.rb Send notification emails when push to a merge request 2018-03-26 13:24:52 +01:00
notification_setting.rb Send notification emails when push to a merge request 2018-03-26 13:24:52 +01:00
oauth_access_grant.rb
oauth_access_token.rb
out_of_context_discussion.rb
pages_domain.rb Add HTTPS-only pages 2018-03-22 19:58:36 +01:00
personal_access_token.rb
personal_snippet.rb
project.rb Add cop for has_many :through without disabled autoloading 2018-04-09 12:47:04 +01:00
project_authorization.rb
project_auto_devops.rb Fix rubocop offense in auto devops predefined variables 2018-03-13 15:26:16 +01:00
project_custom_attribute.rb
project_deploy_token.rb Increase test suite around deploy tokens behavior 2018-04-06 21:20:17 -05:00
project_feature.rb
project_group_link.rb
project_import_data.rb
project_label.rb
project_snippet.rb
project_statistics.rb Fix a bug calculating artifact size for project statistics 2018-01-18 17:48:09 +00:00
project_team.rb Backport relevant changes from EE https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/4827 to CE 2018-03-07 17:01:32 +00:00
project_wiki.rb Change Gitlab::Shell#add_namespace to #create_namespace 2018-03-14 09:56:22 +01:00
protectable_dropdown.rb
protected_branch.rb use Gitlab::UserSettings directly as a singleton instead of including/extending it 2018-02-02 18:39:55 +00:00
protected_ref_matcher.rb
protected_tag.rb
push_event.rb Last push widget will show banner for new pushes to previously merged branch 2018-01-15 16:45:56 -06:00
push_event_payload.rb
readme_blob.rb
redirect_route.rb Remove permanent redirects 2018-03-28 14:12:08 +02:00
release.rb
repository.rb Merge branch '44657-reuse-root_ref_hash-on-branches' into 'master' 2018-03-28 16:16:33 +00:00
route.rb Remove permanent redirects 2018-03-28 14:12:08 +02:00
security_event.rb
sent_notification.rb
service.rb [Rails5] Add FALSE_VALUES constant to Service#boolean_accessor 2018-04-08 09:48:38 +11:00
snippet.rb Add discussion API 2018-03-07 12:27:50 +01:00
snippet_blob.rb
spam_log.rb
subscription.rb
system_note_metadata.rb
timelog.rb
todo.rb Use Goldiloader for handling N+1 queries 2018-04-09 11:58:06 +01:00
tree.rb Migrate recursive tree entries fetching to Gitaly 2018-02-26 16:59:29 +01:00
trending_project.rb
u2f_registration.rb
upload.rb remove EE-only code 2018-03-22 13:00:58 -04:00
user.rb Merge branch 'fix-n-plus-one-when-getting-notification-settings-for-recipients' into 'master' 2018-04-09 15:36:56 +00:00
user_agent_detail.rb
user_callout.rb Bump UserCallout feature_name enum index 2018-02-05 14:26:01 +01:00
user_custom_attribute.rb
user_interacted_project.rb Shortcut and return on duplicate record error. 2018-03-06 12:53:15 +01:00
user_synced_attributes_metadata.rb Moved o_auth/saml/ldap modules under gitlab/auth 2018-02-28 16:53:02 +01:00
users_star_project.rb
wiki_directory.rb
wiki_page.rb Allow moving wiki pages from the UI 2018-02-05 17:17:21 +00:00