summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-07-23 11:26:04 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-07-23 11:26:04 +0000
commitd74f0bfd5c53962e332c2dd4d30dafaa1105b92b (patch)
treef3eaf66d67c3a87fb34340561bf188d364de623c
parent41bb302594b48152b87c92f196c915f499093bbf (diff)
downloadredmine-d74f0bfd5c53962e332c2dd4d30dafaa1105b92b.tar.gz
redmine-d74f0bfd5c53962e332c2dd4d30dafaa1105b92b.zip
Merged rails-5.1 branch (#23630).
git-svn-id: http://svn.redmine.org/redmine/trunk@16859 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--Gemfile11
-rw-r--r--app/controllers/imports_controller.rb4
-rw-r--r--app/controllers/my_controller.rb2
-rw-r--r--app/controllers/project_enumerations_controller.rb19
-rw-r--r--app/controllers/search_controller.rb2
-rw-r--r--app/controllers/settings_controller.rb2
-rw-r--r--app/controllers/users_controller.rb2
-rw-r--r--app/helpers/application_helper.rb2
-rw-r--r--app/models/attachment.rb1
-rw-r--r--app/models/auth_source.rb1
-rw-r--r--app/models/board.rb1
-rw-r--r--app/models/change.rb1
-rw-r--r--app/models/changeset.rb1
-rw-r--r--app/models/comment.rb1
-rw-r--r--app/models/custom_field.rb5
-rw-r--r--app/models/custom_value.rb1
-rw-r--r--app/models/document.rb1
-rw-r--r--app/models/email_address.rb11
-rw-r--r--app/models/enabled_module.rb1
-rw-r--r--app/models/enumeration.rb4
-rw-r--r--app/models/group.rb1
-rw-r--r--app/models/issue.rb67
-rw-r--r--app/models/issue_category.rb1
-rw-r--r--app/models/issue_custom_field.rb4
-rw-r--r--app/models/issue_priority.rb2
-rw-r--r--app/models/issue_relation.rb5
-rw-r--r--app/models/issue_status.rb3
-rw-r--r--app/models/journal.rb1
-rw-r--r--app/models/journal_detail.rb1
-rw-r--r--app/models/member.rb1
-rw-r--r--app/models/member_role.rb1
-rw-r--r--app/models/message.rb5
-rw-r--r--app/models/news.rb1
-rw-r--r--app/models/project.rb25
-rw-r--r--app/models/query.rb6
-rw-r--r--app/models/repository.rb1
-rw-r--r--app/models/repository/bazaar.rb1
-rw-r--r--app/models/repository/filesystem.rb1
-rw-r--r--app/models/repository/git.rb1
-rw-r--r--app/models/repository/mercurial.rb1
-rw-r--r--app/models/repository/subversion.rb1
-rw-r--r--app/models/role.rb1
-rw-r--r--app/models/setting.rb1
-rw-r--r--app/models/time_entry.rb2
-rw-r--r--app/models/token.rb1
-rw-r--r--app/models/tracker.rb2
-rw-r--r--app/models/user.rb19
-rw-r--r--app/models/user_preference.rb2
-rw-r--r--app/models/version.rb7
-rw-r--r--app/models/watcher.rb1
-rw-r--r--app/models/wiki.rb1
-rw-r--r--app/models/wiki_content.rb6
-rw-r--r--app/models/wiki_page.rb7
-rw-r--r--app/models/wiki_redirect.rb1
-rw-r--r--app/models/workflow_rule.rb1
-rw-r--r--app/views/welcome/robots.text.erb (renamed from app/views/welcome/robots.html.erb)0
-rw-r--r--config/application.rb7
-rw-r--r--config/initializers/10-patches.rb28
-rw-r--r--config/initializers/20-mime_types.rb3
-rw-r--r--config/routes.rb30
-rw-r--r--db/migrate/001_setup.rb3
-rw-r--r--db/migrate/002_issue_move.rb2
-rw-r--r--db/migrate/003_issue_add_note.rb2
-rw-r--r--db/migrate/004_export_pdf.rb2
-rw-r--r--db/migrate/005_issue_start_date.rb2
-rw-r--r--db/migrate/006_calendar_and_activity.rb2
-rw-r--r--db/migrate/007_create_journals.rb2
-rw-r--r--db/migrate/008_create_user_preferences.rb2
-rw-r--r--db/migrate/009_add_hide_mail_pref.rb2
-rw-r--r--db/migrate/010_create_comments.rb2
-rw-r--r--db/migrate/011_add_news_comments_count.rb2
-rw-r--r--db/migrate/012_add_comments_permissions.rb2
-rw-r--r--db/migrate/013_create_queries.rb2
-rw-r--r--db/migrate/014_add_queries_permissions.rb2
-rw-r--r--db/migrate/015_create_repositories.rb2
-rw-r--r--db/migrate/016_add_repositories_permissions.rb2
-rw-r--r--db/migrate/017_create_settings.rb2
-rw-r--r--db/migrate/018_set_doc_and_files_notifications.rb2
-rw-r--r--db/migrate/019_add_issue_status_position.rb2
-rw-r--r--db/migrate/020_add_role_position.rb2
-rw-r--r--db/migrate/021_add_tracker_position.rb2
-rw-r--r--db/migrate/022_serialize_possibles_values.rb2
-rw-r--r--db/migrate/023_add_tracker_is_in_roadmap.rb2
-rw-r--r--db/migrate/024_add_roadmap_permission.rb2
-rw-r--r--db/migrate/025_add_search_permission.rb2
-rw-r--r--db/migrate/026_add_repository_login_and_password.rb2
-rw-r--r--db/migrate/027_create_wikis.rb2
-rw-r--r--db/migrate/028_create_wiki_pages.rb2
-rw-r--r--db/migrate/029_create_wiki_contents.rb2
-rw-r--r--db/migrate/030_add_projects_feeds_permissions.rb2
-rw-r--r--db/migrate/031_add_repository_root_url.rb2
-rw-r--r--db/migrate/032_create_time_entries.rb2
-rw-r--r--db/migrate/033_add_timelog_permissions.rb2
-rw-r--r--db/migrate/034_create_changesets.rb2
-rw-r--r--db/migrate/035_create_changes.rb2
-rw-r--r--db/migrate/036_add_changeset_commit_date.rb2
-rw-r--r--db/migrate/037_add_project_identifier.rb2
-rw-r--r--db/migrate/038_add_custom_field_is_filter.rb2
-rw-r--r--db/migrate/039_create_watchers.rb2
-rw-r--r--db/migrate/040_create_changesets_issues.rb2
-rw-r--r--db/migrate/041_rename_comment_to_comments.rb2
-rw-r--r--db/migrate/042_create_issue_relations.rb2
-rw-r--r--db/migrate/043_add_relations_permissions.rb2
-rw-r--r--db/migrate/044_set_language_length_to_five.rb2
-rw-r--r--db/migrate/045_create_boards.rb2
-rw-r--r--db/migrate/046_create_messages.rb2
-rw-r--r--db/migrate/047_add_boards_permissions.rb2
-rw-r--r--db/migrate/048_allow_null_version_effective_date.rb2
-rw-r--r--db/migrate/049_add_wiki_destroy_page_permission.rb2
-rw-r--r--db/migrate/050_add_wiki_attachments_permissions.rb2
-rw-r--r--db/migrate/051_add_project_status.rb2
-rw-r--r--db/migrate/052_add_changes_revision.rb2
-rw-r--r--db/migrate/053_add_changes_branch.rb2
-rw-r--r--db/migrate/054_add_changesets_scmid.rb2
-rw-r--r--db/migrate/055_add_repositories_type.rb2
-rw-r--r--db/migrate/056_add_repositories_changes_permission.rb2
-rw-r--r--db/migrate/057_add_versions_wiki_page_title.rb2
-rw-r--r--db/migrate/058_add_issue_categories_assigned_to_id.rb2
-rw-r--r--db/migrate/059_add_roles_assignable.rb2
-rw-r--r--db/migrate/060_change_changesets_committer_limit.rb2
-rw-r--r--db/migrate/061_add_roles_builtin.rb2
-rw-r--r--db/migrate/062_insert_builtin_roles.rb2
-rw-r--r--db/migrate/063_add_roles_permissions.rb2
-rw-r--r--db/migrate/064_drop_permissions.rb2
-rw-r--r--db/migrate/065_add_settings_updated_on.rb2
-rw-r--r--db/migrate/066_add_custom_value_customized_index.rb2
-rw-r--r--db/migrate/067_create_wiki_redirects.rb2
-rw-r--r--db/migrate/068_create_enabled_modules.rb2
-rw-r--r--db/migrate/069_add_issues_estimated_hours.rb2
-rw-r--r--db/migrate/070_change_attachments_content_type_limit.rb2
-rw-r--r--db/migrate/071_add_queries_column_names.rb2
-rw-r--r--db/migrate/072_add_enumerations_position.rb2
-rw-r--r--db/migrate/073_add_enumerations_is_default.rb2
-rw-r--r--db/migrate/074_add_auth_sources_tls.rb2
-rw-r--r--db/migrate/075_add_members_mail_notification.rb2
-rw-r--r--db/migrate/076_allow_null_position.rb2
-rw-r--r--db/migrate/077_remove_issue_statuses_html_color.rb2
-rw-r--r--db/migrate/078_add_custom_fields_position.rb2
-rw-r--r--db/migrate/079_add_user_preferences_time_zone.rb2
-rw-r--r--db/migrate/080_add_users_type.rb2
-rw-r--r--db/migrate/081_create_projects_trackers.rb2
-rw-r--r--db/migrate/082_add_messages_locked.rb2
-rw-r--r--db/migrate/083_add_messages_sticky.rb2
-rw-r--r--db/migrate/084_change_auth_sources_account_limit.rb2
-rw-r--r--db/migrate/085_add_role_tracker_old_status_index_to_workflows.rb2
-rw-r--r--db/migrate/086_add_custom_fields_searchable.rb2
-rw-r--r--db/migrate/087_change_projects_description_to_text.rb2
-rw-r--r--db/migrate/088_add_custom_fields_default_value.rb2
-rw-r--r--db/migrate/089_add_attachments_description.rb2
-rw-r--r--db/migrate/090_change_versions_name_limit.rb2
-rw-r--r--db/migrate/091_change_changesets_revision_to_string.rb2
-rw-r--r--db/migrate/092_change_changes_from_revision_to_string.rb2
-rw-r--r--db/migrate/093_add_wiki_pages_protected.rb2
-rw-r--r--db/migrate/094_change_projects_homepage_limit.rb2
-rw-r--r--db/migrate/095_add_wiki_pages_parent_id.rb2
-rw-r--r--db/migrate/096_add_commit_access_permission.rb2
-rw-r--r--db/migrate/097_add_view_wiki_edits_permission.rb2
-rw-r--r--db/migrate/098_set_topic_authors_as_watchers.rb2
-rw-r--r--db/migrate/099_add_delete_wiki_pages_attachments_permission.rb2
-rw-r--r--db/migrate/100_add_changesets_user_id.rb2
-rw-r--r--db/migrate/101_populate_changesets_user_id.rb2
-rw-r--r--db/migrate/102_add_custom_fields_editable.rb2
-rw-r--r--db/migrate/103_set_custom_fields_editable.rb2
-rw-r--r--db/migrate/104_add_projects_lft_and_rgt.rb2
-rw-r--r--db/migrate/105_build_projects_tree.rb2
-rw-r--r--db/migrate/106_remove_projects_projects_count.rb2
-rw-r--r--db/migrate/107_add_open_id_authentication_tables.rb2
-rw-r--r--db/migrate/108_add_identity_url_to_users.rb2
-rw-r--r--db/migrate/20090214190337_add_watchers_user_id_type_index.rb2
-rw-r--r--db/migrate/20090312172426_add_queries_sort_criteria.rb2
-rw-r--r--db/migrate/20090312194159_add_projects_trackers_unique_index.rb2
-rw-r--r--db/migrate/20090318181151_extend_settings_name.rb2
-rw-r--r--db/migrate/20090323224724_add_type_to_enumerations.rb2
-rw-r--r--db/migrate/20090401221305_update_enumerations_to_sti.rb2
-rw-r--r--db/migrate/20090401231134_add_active_field_to_enumerations.rb2
-rw-r--r--db/migrate/20090403001910_add_project_to_enumerations.rb2
-rw-r--r--db/migrate/20090406161854_add_parent_id_to_enumerations.rb2
-rw-r--r--db/migrate/20090425161243_add_queries_group_by.rb2
-rw-r--r--db/migrate/20090503121501_create_member_roles.rb2
-rw-r--r--db/migrate/20090503121505_populate_member_roles.rb2
-rw-r--r--db/migrate/20090503121510_drop_members_role_id.rb2
-rw-r--r--db/migrate/20090614091200_fix_messages_sticky_null.rb2
-rw-r--r--db/migrate/20090704172350_populate_users_type.rb2
-rw-r--r--db/migrate/20090704172355_create_groups_users.rb2
-rw-r--r--db/migrate/20090704172358_add_member_roles_inherited_from.rb2
-rw-r--r--db/migrate/20091010093521_fix_users_custom_values.rb2
-rw-r--r--db/migrate/20091017212227_add_missing_indexes_to_workflows.rb2
-rw-r--r--db/migrate/20091017212457_add_missing_indexes_to_custom_fields_projects.rb2
-rw-r--r--db/migrate/20091017212644_add_missing_indexes_to_messages.rb2
-rw-r--r--db/migrate/20091017212938_add_missing_indexes_to_repositories.rb2
-rw-r--r--db/migrate/20091017213027_add_missing_indexes_to_comments.rb2
-rw-r--r--db/migrate/20091017213113_add_missing_indexes_to_enumerations.rb2
-rw-r--r--db/migrate/20091017213151_add_missing_indexes_to_wiki_pages.rb2
-rw-r--r--db/migrate/20091017213228_add_missing_indexes_to_watchers.rb2
-rw-r--r--db/migrate/20091017213257_add_missing_indexes_to_auth_sources.rb2
-rw-r--r--db/migrate/20091017213332_add_missing_indexes_to_documents.rb2
-rw-r--r--db/migrate/20091017213444_add_missing_indexes_to_tokens.rb2
-rw-r--r--db/migrate/20091017213536_add_missing_indexes_to_changesets.rb2
-rw-r--r--db/migrate/20091017213642_add_missing_indexes_to_issue_categories.rb2
-rw-r--r--db/migrate/20091017213716_add_missing_indexes_to_member_roles.rb2
-rw-r--r--db/migrate/20091017213757_add_missing_indexes_to_boards.rb2
-rw-r--r--db/migrate/20091017213835_add_missing_indexes_to_user_preferences.rb2
-rw-r--r--db/migrate/20091017213910_add_missing_indexes_to_issues.rb2
-rw-r--r--db/migrate/20091017214015_add_missing_indexes_to_members.rb2
-rw-r--r--db/migrate/20091017214107_add_missing_indexes_to_custom_fields.rb2
-rw-r--r--db/migrate/20091017214136_add_missing_indexes_to_queries.rb2
-rw-r--r--db/migrate/20091017214236_add_missing_indexes_to_time_entries.rb2
-rw-r--r--db/migrate/20091017214308_add_missing_indexes_to_news.rb2
-rw-r--r--db/migrate/20091017214336_add_missing_indexes_to_users.rb2
-rw-r--r--db/migrate/20091017214406_add_missing_indexes_to_attachments.rb2
-rw-r--r--db/migrate/20091017214440_add_missing_indexes_to_wiki_contents.rb2
-rw-r--r--db/migrate/20091017214519_add_missing_indexes_to_custom_values.rb2
-rw-r--r--db/migrate/20091017214611_add_missing_indexes_to_journals.rb2
-rw-r--r--db/migrate/20091017214644_add_missing_indexes_to_issue_relations.rb2
-rw-r--r--db/migrate/20091017214720_add_missing_indexes_to_wiki_redirects.rb2
-rw-r--r--db/migrate/20091017214750_add_missing_indexes_to_custom_fields_trackers.rb2
-rw-r--r--db/migrate/20091025163651_add_activity_indexes.rb2
-rw-r--r--db/migrate/20091108092559_add_versions_status.rb2
-rw-r--r--db/migrate/20091114105931_add_view_issues_permission.rb2
-rw-r--r--db/migrate/20091123212029_add_default_done_ratio_to_issue_status.rb2
-rw-r--r--db/migrate/20091205124427_add_versions_sharing.rb2
-rw-r--r--db/migrate/20091220183509_add_lft_and_rgt_indexes_to_projects.rb2
-rw-r--r--db/migrate/20091220183727_add_index_to_settings_name.rb2
-rw-r--r--db/migrate/20091220184736_add_indexes_to_issue_status.rb2
-rw-r--r--db/migrate/20091225164732_remove_enumerations_opt.rb2
-rw-r--r--db/migrate/20091227112908_change_wiki_contents_text_limit.rb2
-rw-r--r--db/migrate/20100129193402_change_users_mail_notification_to_string.rb2
-rw-r--r--db/migrate/20100129193813_update_mail_notification_values.rb2
-rw-r--r--db/migrate/20100221100219_add_index_on_changesets_scmid.rb2
-rw-r--r--db/migrate/20100313132032_add_issues_nested_sets_columns.rb2
-rw-r--r--db/migrate/20100313171051_add_index_on_issues_nested_set.rb2
-rw-r--r--db/migrate/20100705164950_change_changes_path_length_limit.rb2
-rw-r--r--db/migrate/20100819172912_enable_calendar_and_gantt_modules_where_appropriate.rb2
-rw-r--r--db/migrate/20101104182107_add_unique_index_on_members.rb2
-rw-r--r--db/migrate/20101107130441_add_custom_fields_visible.rb2
-rw-r--r--db/migrate/20101114115114_change_projects_name_limit.rb2
-rw-r--r--db/migrate/20101114115359_change_projects_identifier_limit.rb2
-rw-r--r--db/migrate/20110220160626_add_workflows_assignee_and_author.rb2
-rw-r--r--db/migrate/20110223180944_add_users_salt.rb2
-rw-r--r--db/migrate/20110223180953_salt_user_passwords.rb2
-rw-r--r--db/migrate/20110224000000_add_repositories_path_encoding.rb2
-rw-r--r--db/migrate/20110226120112_change_repositories_password_limit.rb2
-rw-r--r--db/migrate/20110226120132_change_auth_sources_account_password_limit.rb2
-rw-r--r--db/migrate/20110227125750_change_journal_details_values_to_text.rb2
-rw-r--r--db/migrate/20110228000000_add_repositories_log_encoding.rb2
-rw-r--r--db/migrate/20110228000100_copy_repositories_log_encoding.rb2
-rw-r--r--db/migrate/20110401192910_add_index_to_users_type.rb2
-rw-r--r--db/migrate/20110408103312_add_roles_issues_visibility.rb2
-rw-r--r--db/migrate/20110412065600_add_issues_is_private.rb2
-rw-r--r--db/migrate/20110511000000_add_repositories_extra_info.rb2
-rw-r--r--db/migrate/20110902000000_create_changeset_parents.rb2
-rw-r--r--db/migrate/20111201201315_add_unique_index_to_issue_relations.rb2
-rw-r--r--db/migrate/20120115143024_add_repositories_identifier.rb2
-rw-r--r--db/migrate/20120115143100_add_repositories_is_default.rb2
-rw-r--r--db/migrate/20120115143126_set_default_repositories.rb2
-rw-r--r--db/migrate/20120127174243_add_custom_fields_multiple.rb2
-rw-r--r--db/migrate/20120205111326_change_users_login_limit.rb2
-rw-r--r--db/migrate/20120223110929_change_attachments_container_defaults.rb2
-rw-r--r--db/migrate/20120301153455_add_auth_sources_filter.rb2
-rw-r--r--db/migrate/20120422150750_change_repositories_to_full_sti.rb2
-rw-r--r--db/migrate/20120705074331_add_trackers_fields_bits.rb2
-rw-r--r--db/migrate/20120707064544_add_auth_sources_timeout.rb2
-rw-r--r--db/migrate/20120714122000_add_workflows_type.rb2
-rw-r--r--db/migrate/20120714122100_update_workflows_to_sti.rb2
-rw-r--r--db/migrate/20120714122200_add_workflows_rule_fields.rb2
-rw-r--r--db/migrate/20120731164049_add_boards_parent_id.rb2
-rw-r--r--db/migrate/20120930112914_add_journals_private_notes.rb2
-rw-r--r--db/migrate/20121026002032_add_enumerations_position_name.rb2
-rw-r--r--db/migrate/20121026003537_populate_enumerations_position_name.rb2
-rw-r--r--db/migrate/20121209123234_add_queries_type.rb2
-rw-r--r--db/migrate/20121209123358_update_queries_to_sti.rb2
-rw-r--r--db/migrate/20121213084931_add_attachments_disk_directory.rb2
-rw-r--r--db/migrate/20130110122628_split_documents_permissions.rb2
-rw-r--r--db/migrate/20130201184705_add_unique_index_on_tokens_value.rb2
-rw-r--r--db/migrate/20130202090625_add_projects_inherit_members.rb2
-rw-r--r--db/migrate/20130207175206_add_unique_index_on_custom_fields_trackers.rb2
-rw-r--r--db/migrate/20130207181455_add_unique_index_on_custom_fields_projects.rb2
-rw-r--r--db/migrate/20130215073721_change_users_lastname_length_to_255.rb2
-rw-r--r--db/migrate/20130215111127_add_issues_closed_on.rb2
-rw-r--r--db/migrate/20130215111141_populate_issues_closed_on.rb2
-rw-r--r--db/migrate/20130217094251_remove_issues_default_fk_values.rb2
-rw-r--r--db/migrate/20130602092539_create_queries_roles.rb2
-rw-r--r--db/migrate/20130710182539_add_queries_visibility.rb2
-rw-r--r--db/migrate/20130713104233_create_custom_fields_roles.rb2
-rw-r--r--db/migrate/20130713111657_add_queries_options.rb2
-rw-r--r--db/migrate/20130729070143_add_users_must_change_passwd.rb2
-rw-r--r--db/migrate/20130911193200_remove_eols_from_attachments_filename.rb2
-rw-r--r--db/migrate/20131004113137_support_for_multiple_commit_keywords.rb2
-rw-r--r--db/migrate/20131005100610_add_repositories_created_on.rb2
-rw-r--r--db/migrate/20131124175346_add_custom_fields_format_store.rb2
-rw-r--r--db/migrate/20131210180802_add_custom_fields_description.rb2
-rw-r--r--db/migrate/20131214094309_remove_custom_fields_min_max_length_default_values.rb2
-rw-r--r--db/migrate/20131215104612_store_relation_type_in_journal_details.rb2
-rw-r--r--db/migrate/20131218183023_delete_orphan_time_entries_custom_values.rb2
-rw-r--r--db/migrate/20140228130325_change_changesets_comments_limit.rb2
-rw-r--r--db/migrate/20140903143914_add_password_changed_at_to_user.rb10
-rw-r--r--db/migrate/20140920094058_insert_builtin_groups.rb2
-rw-r--r--db/migrate/20141029181752_add_trackers_default_status_id.rb2
-rw-r--r--db/migrate/20141029181824_remove_issue_statuses_is_default.rb2
-rw-r--r--db/migrate/20141109112308_add_roles_users_visibility.rb2
-rw-r--r--db/migrate/20141122124142_add_wiki_redirects_redirects_to_wiki_id.rb2
-rw-r--r--db/migrate/20150113194759_create_email_addresses.rb2
-rw-r--r--db/migrate/20150113211532_populate_email_addresses.rb2
-rw-r--r--db/migrate/20150113213922_remove_users_mail.rb2
-rw-r--r--db/migrate/20150113213955_add_email_addresses_user_id_index.rb2
-rw-r--r--db/migrate/20150208105930_replace_move_issues_permission.rb2
-rw-r--r--db/migrate/20150510083747_change_documents_title_limit.rb2
-rw-r--r--db/migrate/20150525103953_clear_estimated_hours_on_parent_issues.rb2
-rw-r--r--db/migrate/20150526183158_add_roles_time_entries_visibility.rb2
-rw-r--r--db/migrate/20150528084820_add_roles_all_roles_managed.rb2
-rw-r--r--db/migrate/20150528092912_create_roles_managed_roles.rb2
-rw-r--r--db/migrate/20150528093249_add_unique_index_on_roles_managed_roles.rb2
-rw-r--r--db/migrate/20150725112753_insert_allowed_statuses_for_new_issues.rb2
-rw-r--r--db/migrate/20150730122707_create_imports.rb2
-rw-r--r--db/migrate/20150730122735_create_import_items.rb2
-rw-r--r--db/migrate/20150921204850_change_time_entries_comments_limit_to_1024.rb2
-rw-r--r--db/migrate/20150921210243_change_wiki_contents_comments_limit_to_1024.rb2
-rw-r--r--db/migrate/20151020182334_change_attachments_filesize_limit_to_8.rb2
-rw-r--r--db/migrate/20151020182731_fix_comma_in_user_format_setting_value.rb2
-rw-r--r--db/migrate/20151021184614_change_issue_categories_name_limit_to_60.rb2
-rw-r--r--db/migrate/20151021185456_change_auth_sources_filter_to_text.rb2
-rw-r--r--db/migrate/20151021190616_change_user_preferences_hide_mail_default_to_true.rb2
-rw-r--r--db/migrate/20151024082034_add_tokens_updated_on.rb2
-rw-r--r--db/migrate/20151025072118_create_custom_field_enumerations.rb2
-rw-r--r--db/migrate/20151031095005_add_projects_default_version_id.rb2
-rw-r--r--db/migrate/20160404080304_force_password_reset_during_setup.rb2
-rw-r--r--db/migrate/20160416072926_remove_position_defaults.rb2
-rw-r--r--db/migrate/20160529063352_add_roles_settings.rb2
-rw-r--r--db/migrate/20161001122012_add_tracker_id_index_to_workflows.rb2
-rw-r--r--db/migrate/20161002133421_add_index_on_member_roles_inherited_from.rb2
-rw-r--r--db/migrate/20161010081301_change_issues_description_limit.rb2
-rw-r--r--db/migrate/20161010081528_change_journal_details_value_limit.rb2
-rw-r--r--db/migrate/20161010081600_change_journals_notes_limit.rb2
-rw-r--r--db/migrate/20161126094932_add_index_on_changesets_issues_issue_id.rb10
-rw-r--r--db/migrate/20161220091118_add_index_on_issues_parent_id.rb2
-rw-r--r--db/migrate/20170207050700_add_index_on_disk_filename_to_attachments.rb2
-rw-r--r--db/migrate/20170302015225_change_attachments_digest_limit_to_64.rb2
-rw-r--r--db/migrate/20170309214320_add_project_default_assigned_to_id.rb2
-rw-r--r--db/migrate/20170320051650_change_repositories_extra_info_limit.rb2
-rw-r--r--db/migrate/20170418090031_add_view_news_to_all_existing_roles.rb2
-rw-r--r--db/migrate/20170419144536_add_view_messages_to_all_existing_roles.rb2
-rw-r--r--lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb6
-rw-r--r--lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb1
-rw-r--r--lib/redmine/acts/positioned.rb19
-rw-r--r--lib/redmine/field_format.rb6
-rw-r--r--lib/redmine/safe_attributes.rb4
-rw-r--r--lib/redmine/sudo_mode.rb2
-rw-r--r--lib/tasks/redmine.rake28
-rw-r--r--lib/tasks/testing.rake30
-rw-r--r--public/javascripts/jquery-1.11.1-ui-1.11.0-ujs-5.1.2.js (renamed from public/javascripts/jquery-1.11.1-ui-1.11.0-ujs-3.1.4.js)4
-rw-r--r--test/extra/redmine_pm/test_case.rb2
-rw-r--r--test/functional/issues_controller_test.rb4
-rw-r--r--test/functional/issues_controller_transaction_test.rb2
-rw-r--r--test/functional/project_enumerations_controller_test.rb2
-rw-r--r--test/functional/repositories_bazaar_controller_test.rb3
-rw-r--r--test/functional/repositories_controller_test.rb3
-rw-r--r--test/functional/repositories_cvs_controller_test.rb3
-rw-r--r--test/functional/repositories_darcs_controller_test.rb3
-rw-r--r--test/functional/repositories_filesystem_controller_test.rb3
-rw-r--r--test/functional/repositories_git_controller_test.rb3
-rw-r--r--test/functional/repositories_mercurial_controller_test.rb3
-rw-r--r--test/functional/repositories_subversion_controller_test.rb3
-rw-r--r--test/functional/users_controller_test.rb6
-rw-r--r--test/functional/welcome_controller_test.rb7
-rw-r--r--test/integration/api_test/attachments_test.rb2
-rw-r--r--test/integration/application_test.rb4
-rw-r--r--test/integration/lib/redmine/field_format/attachment_format_test.rb2
-rw-r--r--test/integration/routing/attachments_test.rb3
-rw-r--r--test/integration/routing/repositories_test.rb94
-rw-r--r--test/integration/routing/welcome_test.rb2
-rw-r--r--test/integration/welcome_test.rb28
-rw-r--r--test/test_helper.rb40
-rw-r--r--test/ui/base.rb2
-rw-r--r--test/unit/attachment_test.rb4
-rw-r--r--test/unit/attachment_transaction_test.rb2
-rw-r--r--test/unit/issue_nested_set_concurrency_test.rb2
-rw-r--r--test/unit/issue_test.rb4
-rw-r--r--test/unit/issue_transaction_test.rb2
-rw-r--r--test/unit/lib/redmine/views/builders/json_test.rb2
-rw-r--r--test/unit/lib/redmine/views/builders/xml_test.rb2
-rw-r--r--test/unit/project_nested_set_concurrency_test.rb2
381 files changed, 602 insertions, 644 deletions
diff --git a/Gemfile b/Gemfile
index aa49e527b..3ddf0f229 100644
--- a/Gemfile
+++ b/Gemfile
@@ -4,18 +4,16 @@ if Gem::Version.new(Bundler::VERSION) < Gem::Version.new('1.5.0')
abort "Redmine requires Bundler 1.5.0 or higher (you're using #{Bundler::VERSION}).\nPlease update with 'gem update bundler'."
end
-gem "rails", "4.2.8"
-gem "jquery-rails", "~> 3.1.4"
+gem "rails", "5.1.2"
gem "coderay", "~> 1.1.1"
gem "request_store", "1.0.5"
gem "mime-types", "~> 3.0"
-gem "protected_attributes"
gem "actionpack-xml_parser"
-gem "roadie-rails", "~> 1.1.1"
+gem "roadie-rails"
gem "roadie", "~> 3.2.1"
gem "mimemagic"
-gem "nokogiri", (RUBY_VERSION >= "2.1" ? "~> 1.7.2" : "~> 1.6.8")
+gem "nokogiri", "~> 1.7.2"
gem "i18n", "~> 0.7.0"
# Request at least rails-html-sanitizer 1.0.3 because of security advisories
@@ -85,12 +83,9 @@ group :development do
end
group :test do
- gem "minitest"
gem "rails-dom-testing"
gem "mocha"
gem "simplecov", "~> 0.14.1", :require => false
- # TODO: remove this after upgrading to Rails 5
- gem "test_after_commit", "~> 0.4.2"
# For running UI tests
gem "capybara"
gem "selenium-webdriver", "~> 2.53.4"
diff --git a/app/controllers/imports_controller.rb b/app/controllers/imports_controller.rb
index 96589ac65..661eb7405 100644
--- a/app/controllers/imports_controller.rb
+++ b/app/controllers/imports_controller.rb
@@ -109,9 +109,9 @@ class ImportsController < ApplicationController
end
def update_from_params
- if params[:import_settings].is_a?(Hash)
+ if params[:import_settings].present?
@import.settings ||= {}
- @import.settings.merge!(params[:import_settings])
+ @import.settings.merge!(params[:import_settings].to_unsafe_hash)
@import.save!
end
end
diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb
index bf04d55af..4e9f67d7d 100644
--- a/app/controllers/my_controller.rb
+++ b/app/controllers/my_controller.rb
@@ -138,7 +138,7 @@ class MyController < ApplicationController
block_settings = params[:settings] || {}
block_settings.each do |block, settings|
- @user.pref.update_block_settings(block, settings)
+ @user.pref.update_block_settings(block, settings.to_unsafe_hash)
end
@user.pref.save
@updated_blocks = block_settings.keys
diff --git a/app/controllers/project_enumerations_controller.rb b/app/controllers/project_enumerations_controller.rb
index f68d94869..d9a77f969 100644
--- a/app/controllers/project_enumerations_controller.rb
+++ b/app/controllers/project_enumerations_controller.rb
@@ -20,15 +20,8 @@ class ProjectEnumerationsController < ApplicationController
before_action :authorize
def update
- if params[:enumerations]
- saved = Project.transaction do
- params[:enumerations].each do |id, activity|
- @project.update_or_create_time_entry_activity(id, activity)
- end
- end
- if saved
- flash[:notice] = l(:notice_successful_update)
- end
+ if @project.update_or_create_time_entry_activities(update_params)
+ flash[:notice] = l(:notice_successful_update)
end
redirect_to settings_project_path(@project, :tab => 'activities')
@@ -41,4 +34,12 @@ class ProjectEnumerationsController < ApplicationController
flash[:notice] = l(:notice_successful_update)
redirect_to settings_project_path(@project, :tab => 'activities')
end
+
+ private
+
+ def update_params
+ params.
+ permit(:enumerations => [:parent_id, :active, {:custom_field_values => {}}]).
+ require(:enumerations)
+ end
end
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb
index 2887db9a3..00b023872 100644
--- a/app/controllers/search_controller.rb
+++ b/app/controllers/search_controller.rb
@@ -68,7 +68,7 @@ class SearchController < ApplicationController
fetcher = Redmine::Search::Fetcher.new(
@question, User.current, @scope, projects_to_search,
:all_words => @all_words, :titles_only => @titles_only, :attachments => @search_attachments, :open_issues => @open_issues,
- :cache => params[:page].present?, :params => params
+ :cache => params[:page].present?, :params => params.to_unsafe_hash
)
if fetcher.tokens.present?
diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb
index 7b2dceb31..f4109571f 100644
--- a/app/controllers/settings_controller.rb
+++ b/app/controllers/settings_controller.rb
@@ -34,7 +34,7 @@ class SettingsController < ApplicationController
def edit
@notifiables = Redmine::Notifiable.all
if request.post?
- errors = Setting.set_all_from_params(params[:settings])
+ errors = Setting.set_all_from_params(params[:settings].to_unsafe_hash)
if errors.blank?
flash[:notice] = l(:notice_successful_update)
redirect_to settings_path(:tab => params[:tab])
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 0133f9797..653a37666 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -101,7 +101,7 @@ class UsersController < ApplicationController
format.html {
flash[:notice] = l(:notice_user_successful_create, :id => view_context.link_to(@user.login, user_path(@user)))
if params[:continue]
- attrs = params[:user].slice(:generate_password)
+ attrs = {:generate_password => @user.generate_password }
redirect_to new_user_path(:user => attrs)
else
redirect_to edit_user_path(@user)
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index b8cb965c7..b43f817ba 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1440,7 +1440,7 @@ module ApplicationHelper
# Returns the javascript tags that are included in the html layout head
def javascript_heads
- tags = javascript_include_tag('jquery-1.11.1-ui-1.11.0-ujs-3.1.4', 'application', 'responsive')
+ tags = javascript_include_tag('jquery-1.11.1-ui-1.11.0-ujs-5.1.2', 'application', 'responsive')
unless User.current.pref.warn_on_leaving_unsaved == '0'
tags << "\n".html_safe + javascript_tag("$(window).load(function(){ warnLeavingUnsaved('#{escape_javascript l(:text_warn_on_leaving_unsaved)}'); });")
end
diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index eea80132c..b967e5720 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -28,7 +28,6 @@ class Attachment < ActiveRecord::Base
validates_length_of :disk_filename, :maximum => 255
validates_length_of :description, :maximum => 255
validate :validate_max_file_size, :validate_file_extension
- attr_protected :id
acts_as_event :title => :filename,
:url => Proc.new {|o| {:controller => 'attachments', :action => 'show', :id => o.id, :filename => o.filename}}
diff --git a/app/models/auth_source.rb b/app/models/auth_source.rb
index 4954c962d..c28a33fb2 100644
--- a/app/models/auth_source.rb
+++ b/app/models/auth_source.rb
@@ -30,7 +30,6 @@ class AuthSource < ActiveRecord::Base
validates_presence_of :name
validates_uniqueness_of :name
validates_length_of :name, :maximum => 60
- attr_protected :id
safe_attributes 'name',
'host',
diff --git a/app/models/board.rb b/app/models/board.rb
index 21461e32f..7f09fddbe 100644
--- a/app/models/board.rb
+++ b/app/models/board.rb
@@ -28,7 +28,6 @@ class Board < ActiveRecord::Base
validates_length_of :name, :maximum => 30
validates_length_of :description, :maximum => 255
validate :validate_board
- attr_protected :id
scope :visible, lambda {|*args|
joins(:project).
diff --git a/app/models/change.rb b/app/models/change.rb
index e0d25f3a9..ce75239f1 100644
--- a/app/models/change.rb
+++ b/app/models/change.rb
@@ -21,7 +21,6 @@ class Change < ActiveRecord::Base
validates_presence_of :changeset_id, :action, :path
before_save :init_path
before_validation :replace_invalid_utf8_of_path
- attr_protected :id
def replace_invalid_utf8_of_path
self.path = Redmine::CodesetUtil.replace_invalid_utf8(self.path)
diff --git a/app/models/changeset.rb b/app/models/changeset.rb
index 4256f0589..637a1819f 100644
--- a/app/models/changeset.rb
+++ b/app/models/changeset.rb
@@ -46,7 +46,6 @@ class Changeset < ActiveRecord::Base
validates_presence_of :repository_id, :revision, :committed_on, :commit_date
validates_uniqueness_of :revision, :scope => :repository_id
validates_uniqueness_of :scmid, :scope => :repository_id, :allow_nil => true
- attr_protected :id
scope :visible, lambda {|*args|
joins(:repository => :project).
diff --git a/app/models/comment.rb b/app/models/comment.rb
index 48b47d970..e29b574c1 100644
--- a/app/models/comment.rb
+++ b/app/models/comment.rb
@@ -21,7 +21,6 @@ class Comment < ActiveRecord::Base
belongs_to :author, :class_name => 'User'
validates_presence_of :commented, :author, :comments
- attr_protected :id
after_create :send_notification
diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb
index ca061a25f..58911b5f7 100644
--- a/app/models/custom_field.rb
+++ b/app/models/custom_field.rb
@@ -35,7 +35,6 @@ class CustomField < ActiveRecord::Base
validates_length_of :regexp, maximum: 255
validates_inclusion_of :field_format, :in => Proc.new { Redmine::FieldFormat.available_formats }
validate :validate_custom_field
- attr_protected :id
before_validation :set_searchable
before_save do |field|
@@ -43,7 +42,7 @@ class CustomField < ActiveRecord::Base
end
after_save :handle_multiplicity_change
after_save do |field|
- if field.visible_changed? && field.visible
+ if field.saved_change_to_visible? && field.visible
field.roles.clear
end
end
@@ -316,7 +315,7 @@ class CustomField < ActiveRecord::Base
# Removes multiple values for the custom field after setting the multiple attribute to false
# We kepp the value with the highest id for each customized object
def handle_multiplicity_change
- if !new_record? && multiple_was && !multiple
+ if !new_record? && multiple_before_last_save && !multiple
ids = custom_values.
where("EXISTS(SELECT 1 FROM #{CustomValue.table_name} cve WHERE cve.custom_field_id = #{CustomValue.table_name}.custom_field_id" +
" AND cve.customized_type = #{CustomValue.table_name}.customized_type AND cve.customized_id = #{CustomValue.table_name}.customized_id" +
diff --git a/app/models/custom_value.rb b/app/models/custom_value.rb
index b649ec81d..9a5610930 100644
--- a/app/models/custom_value.rb
+++ b/app/models/custom_value.rb
@@ -18,7 +18,6 @@
class CustomValue < ActiveRecord::Base
belongs_to :custom_field
belongs_to :customized, :polymorphic => true
- attr_protected :id
after_save :custom_field_after_save_custom_value
diff --git a/app/models/document.rb b/app/models/document.rb
index d347e583c..8e4b15517 100644
--- a/app/models/document.rb
+++ b/app/models/document.rb
@@ -31,7 +31,6 @@ class Document < ActiveRecord::Base
validates_presence_of :project, :title, :category
validates_length_of :title, :maximum => 255
- attr_protected :id
after_create :send_notification
diff --git a/app/models/email_address.rb b/app/models/email_address.rb
index 295b9bcaa..d144e2f88 100644
--- a/app/models/email_address.rb
+++ b/app/models/email_address.rb
@@ -19,7 +19,6 @@ class EmailAddress < ActiveRecord::Base
include Redmine::SafeAttributes
belongs_to :user
- attr_protected :id
after_create :deliver_security_notification_create
after_update :destroy_tokens, :deliver_security_notification_update
@@ -63,17 +62,17 @@ class EmailAddress < ActiveRecord::Base
# send a security notification to user that an email has been changed (notified/not notified)
def deliver_security_notification_update
- if address_changed?
- recipients = [user, address_was]
+ if saved_change_to_address?
+ recipients = [user, address_before_last_save]
options = {
message: :mail_body_security_notification_change_to,
field: :field_mail,
value: address
}
- elsif notify_changed?
+ elsif saved_change_to_notify?
recipients = [user, address]
options = {
- message: notify_was ? :mail_body_security_notification_notify_disabled : :mail_body_security_notification_notify_enabled,
+ message: notify_before_last_save ? :mail_body_security_notification_notify_disabled : :mail_body_security_notification_notify_enabled,
value: address
}
end
@@ -103,7 +102,7 @@ class EmailAddress < ActiveRecord::Base
# This helps to keep the account secure in case the associated email account
# was compromised.
def destroy_tokens
- if address_changed? || destroyed?
+ if saved_change_to_address? || destroyed?
tokens = ['recovery']
Token.where(:user_id => user_id, :action => tokens).delete_all
end
diff --git a/app/models/enabled_module.rb b/app/models/enabled_module.rb
index 2548ba25d..12511662c 100644
--- a/app/models/enabled_module.rb
+++ b/app/models/enabled_module.rb
@@ -21,7 +21,6 @@ class EnabledModule < ActiveRecord::Base
validates_presence_of :name
validates_uniqueness_of :name, :scope => :project_id
- attr_protected :id
after_create :module_enabled
diff --git a/app/models/enumeration.rb b/app/models/enumeration.rb
index eef691c4c..f330da085 100644
--- a/app/models/enumeration.rb
+++ b/app/models/enumeration.rb
@@ -29,8 +29,6 @@ class Enumeration < ActiveRecord::Base
before_destroy :check_integrity
before_save :check_default
- attr_protected :type
-
validates_presence_of :name
validates_uniqueness_of :name, :scope => [:type, :project_id]
validates_length_of :name, :maximum => 30
@@ -148,7 +146,7 @@ class Enumeration < ActiveRecord::Base
# position as the overridden enumeration
def update_position
super
- if position_changed?
+ if saved_change_to_position?
self.class.where.not(:parent_id => nil).update_all(
"position = coalesce((
select position
diff --git a/app/models/group.rb b/app/models/group.rb
index d94ef753c..b81e877af 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -28,7 +28,6 @@ class Group < Principal
validates_presence_of :lastname
validates_uniqueness_of :lastname, :case_sensitive => false
validates_length_of :lastname, :maximum => 255
- attr_protected :id
self.valid_statuses = [STATUS_ACTIVE]
diff --git a/app/models/issue.rb b/app/models/issue.rb
index f984e0332..5798fef9f 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -69,7 +69,6 @@ class Issue < ActiveRecord::Base
validates :start_date, :date => true
validates :due_date, :date => true
validate :validate_issue, :validate_required_fields, :validate_permissions
- attr_protected :id
scope :visible, lambda {|*args|
joins(:project).
@@ -108,16 +107,14 @@ class Issue < ActiveRecord::Base
before_validation :default_assign, on: :create
before_validation :clear_disabled_fields
before_save :close_duplicates, :update_done_ratio_from_issue_status,
- :force_updated_on_change, :update_closed_on, :set_assigned_to_was
- after_save {|issue| issue.send :after_project_change if !issue.id_changed? && issue.project_id_changed?}
+ :force_updated_on_change, :update_closed_on
+ after_save {|issue| issue.send :after_project_change if !issue.saved_change_to_id? && issue.saved_change_to_project_id?}
after_save :reschedule_following_issues, :update_nested_set_attributes,
:update_parent_attributes, :delete_selected_attachments, :create_journal
# Should be after_create but would be called before previous after_save callbacks
after_save :after_create_from_copy
after_destroy :update_parent_attributes
after_create :send_notification
- # Keep it at the end of after_save callbacks
- after_save :clear_assigned_to_was
# Returns a SQL conditions string used to find all issues visible by the specified user
def self.visible_condition(user, options={})
@@ -208,7 +205,7 @@ class Issue < ActiveRecord::Base
end
end
- def create_or_update
+ def create_or_update(*args)
super
ensure
@status_was = nil
@@ -512,6 +509,10 @@ class Issue < ActiveRecord::Base
# attr_accessible is too rough because we still want things like
# Issue.new(:project => foo) to work
def safe_attributes=(attrs, user=User.current)
+ if attrs.respond_to?(:to_unsafe_hash)
+ attrs = attrs.to_unsafe_hash
+ end
+
@attributes_set_by = user
return unless attrs.is_a?(Hash)
@@ -586,8 +587,7 @@ class Issue < ActiveRecord::Base
attrs['custom_fields'].select! {|c| editable_custom_field_ids.include?(c['id'].to_s)}
end
- # mass-assignment security bypass
- assign_attributes attrs, :without_protection => true
+ assign_attributes attrs
end
def disabled_core_fields
@@ -1007,32 +1007,27 @@ class Issue < ActiveRecord::Base
statuses
end
- # Returns the previous assignee (user or group) if changed
- def assigned_to_was
- # assigned_to_id_was is reset before after_save callbacks
- user_id = @previous_assigned_to_id || assigned_to_id_was
- if user_id && user_id != assigned_to_id
- @assigned_to_was ||= Principal.find_by_id(user_id)
- end
- end
-
# Returns the original tracker
def tracker_was
- Tracker.find_by_id(tracker_id_was)
+ Tracker.find_by_id(tracker_id_in_database)
+ end
+
+ # Returns the previous assignee whenever we're before the save
+ # or in after_* callbacks
+ def previous_assignee
+ # This is how ActiveRecord::AttributeMethods::Dirty checks if we're in a after_* callback
+ if previous_assigned_to_id = mutation_tracker.equal?(mutations_from_database) ? assigned_to_id_in_database : assigned_to_id_before_last_save
+ Principal.find_by_id(previous_assigned_to_id)
+ end
end
# Returns the users that should be notified
def notified_users
- notified = []
# Author and assignee are always notified unless they have been
# locked or don't want to be notified
- notified << author if author
- if assigned_to
- notified += (assigned_to.is_a?(Group) ? assigned_to.users : [assigned_to])
- end
- if assigned_to_was
- notified += (assigned_to_was.is_a?(Group) ? assigned_to_was.users : [assigned_to_was])
- end
+ notified = [author, assigned_to, previous_assignee].compact.uniq
+ notified = notified.map {|n| n.is_a?(Group) ? n.users : n}.flatten
+ notified.uniq!
notified = notified.select {|u| u.active? && u.notify_about?(self)}
notified += project.notified_users
@@ -1587,7 +1582,7 @@ class Issue < ActiveRecord::Base
# Move subtasks that were in the same project
children.each do |child|
- next unless child.project_id == project_id_was
+ next unless child.project_id == project_id_before_last_save
# Change project and keep project
child.send :project=, project, true
unless child.save
@@ -1644,7 +1639,7 @@ class Issue < ActiveRecord::Base
end
def update_nested_set_attributes
- if parent_id_changed?
+ if saved_change_to_parent_id?
update_nested_set_attributes_on_parent_change
end
remove_instance_variable(:@parent_issue) if instance_variable_defined?(:@parent_issue)
@@ -1652,7 +1647,7 @@ class Issue < ActiveRecord::Base
# Updates the nested set for when an existing issue is moved
def update_nested_set_attributes_on_parent_change
- former_parent_id = parent_id_was
+ former_parent_id = parent_id_before_last_save
# delete invalid relations of all descendants
self_and_descendants.each do |issue|
issue.relations.each do |relation|
@@ -1789,7 +1784,7 @@ class Issue < ActiveRecord::Base
# Updates start/due dates of following issues
def reschedule_following_issues
- if start_date_changed? || due_date_changed?
+ if saved_change_to_start_date? || saved_change_to_due_date?
relations_from.each do |relation|
relation.set_issue_to_dates
end
@@ -1848,18 +1843,6 @@ class Issue < ActiveRecord::Base
end
end
- # Stores the previous assignee so we can still have access
- # to it during after_save callbacks (assigned_to_id_was is reset)
- def set_assigned_to_was
- @previous_assigned_to_id = assigned_to_id_was
- end
-
- # Clears the previous assignee at the end of after_save callbacks
- def clear_assigned_to_was
- @assigned_to_was = nil
- @previous_assigned_to_id = nil
- end
-
def clear_disabled_fields
if tracker
tracker.disabled_core_fields.each do |attribute|
diff --git a/app/models/issue_category.rb b/app/models/issue_category.rb
index da96a85eb..506ae483d 100644
--- a/app/models/issue_category.rb
+++ b/app/models/issue_category.rb
@@ -24,7 +24,6 @@ class IssueCategory < ActiveRecord::Base
validates_presence_of :name
validates_uniqueness_of :name, :scope => [:project_id]
validates_length_of :name, :maximum => 60
- attr_protected :id
safe_attributes 'name', 'assigned_to_id'
diff --git a/app/models/issue_custom_field.rb b/app/models/issue_custom_field.rb
index fb7accd34..f0a7871b0 100644
--- a/app/models/issue_custom_field.rb
+++ b/app/models/issue_custom_field.rb
@@ -16,8 +16,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class IssueCustomField < CustomField
- has_and_belongs_to_many :projects, :join_table => "#{table_name_prefix}custom_fields_projects#{table_name_suffix}", :foreign_key => "custom_field_id"
- has_and_belongs_to_many :trackers, :join_table => "#{table_name_prefix}custom_fields_trackers#{table_name_suffix}", :foreign_key => "custom_field_id"
+ has_and_belongs_to_many :projects, :join_table => "#{table_name_prefix}custom_fields_projects#{table_name_suffix}", :foreign_key => "custom_field_id", :autosave => true
+ has_and_belongs_to_many :trackers, :join_table => "#{table_name_prefix}custom_fields_trackers#{table_name_suffix}", :foreign_key => "custom_field_id", :autosave => true
has_many :issues, :through => :issue_custom_values
safe_attributes 'project_ids',
diff --git a/app/models/issue_priority.rb b/app/models/issue_priority.rb
index 0858cbf0f..a4c93370e 100644
--- a/app/models/issue_priority.rb
+++ b/app/models/issue_priority.rb
@@ -19,7 +19,7 @@ class IssuePriority < Enumeration
has_many :issues, :foreign_key => 'priority_id'
after_destroy {|priority| priority.class.compute_position_names}
- after_save {|priority| priority.class.compute_position_names if (priority.position_changed? && priority.position) || priority.active_changed?}
+ after_save {|priority| priority.class.compute_position_names if (priority.saved_change_to_position? && priority.position) || priority.saved_change_to_active?}
OptionName = :enumeration_issue_priorities
diff --git a/app/models/issue_relation.rb b/app/models/issue_relation.rb
index d8673596c..44c7c8dba 100644
--- a/app/models/issue_relation.rb
+++ b/app/models/issue_relation.rb
@@ -72,7 +72,6 @@ class IssueRelation < ActiveRecord::Base
validates_uniqueness_of :issue_to_id, :scope => :issue_from_id
validate :validate_issue_relation
- attr_protected :issue_from_id, :issue_to_id
before_save :handle_issue_order
after_create :call_issues_relation_added_callback
after_destroy :call_issues_relation_removed_callback
@@ -82,6 +81,10 @@ class IssueRelation < ActiveRecord::Base
'issue_to_id'
def safe_attributes=(attrs, user=User.current)
+ if attrs.respond_to?(:to_unsafe_hash)
+ attrs = attrs.to_unsafe_hash
+ end
+
return unless attrs.is_a?(Hash)
attrs = attrs.deep_dup
diff --git a/app/models/issue_status.rb b/app/models/issue_status.rb
index 6d29cfc8d..9f139f2fc 100644
--- a/app/models/issue_status.rb
+++ b/app/models/issue_status.rb
@@ -30,7 +30,6 @@ class IssueStatus < ActiveRecord::Base
validates_uniqueness_of :name
validates_length_of :name, :maximum => 30
validates_inclusion_of :default_done_ratio, :in => 0..100, :allow_nil => true
- attr_protected :id
scope :sorted, lambda { order(:position) }
scope :named, lambda {|arg| where("LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip)}
@@ -89,7 +88,7 @@ class IssueStatus < ActiveRecord::Base
# Updates issues closed_on attribute when an existing status is set as closed.
def handle_is_closed_change
- if is_closed_changed? && is_closed == true
+ if saved_change_to_is_closed? && is_closed == true
# First we update issues that have a journal for when the current status was set,
# a subselect is used to update all issues with a single query
subquery = Journal.joins(:details).
diff --git a/app/models/journal.rb b/app/models/journal.rb
index 0d2e479ca..77823d0c2 100644
--- a/app/models/journal.rb
+++ b/app/models/journal.rb
@@ -26,7 +26,6 @@ class Journal < ActiveRecord::Base
belongs_to :user
has_many :details, :class_name => "JournalDetail", :dependent => :delete_all, :inverse_of => :journal
attr_accessor :indice
- attr_protected :id
acts_as_event :title => Proc.new {|o| status = ((s = o.new_status) ? " (#{s})" : nil); "#{o.issue.tracker} ##{o.issue.id}#{status}: #{o.issue.subject}" },
:description => :notes,
diff --git a/app/models/journal_detail.rb b/app/models/journal_detail.rb
index f901d2702..8de9b8dbc 100644
--- a/app/models/journal_detail.rb
+++ b/app/models/journal_detail.rb
@@ -17,7 +17,6 @@
class JournalDetail < ActiveRecord::Base
belongs_to :journal
- attr_protected :id
def custom_field
if property == 'cf'
diff --git a/app/models/member.rb b/app/models/member.rb
index f9e3f5679..05bb0d441 100644
--- a/app/models/member.rb
+++ b/app/models/member.rb
@@ -25,7 +25,6 @@ class Member < ActiveRecord::Base
validates_presence_of :principal, :project
validates_uniqueness_of :user_id, :scope => :project_id
validate :validate_role
- attr_protected :id
before_destroy :set_issue_category_nil, :remove_from_project_default_assigned_to
diff --git a/app/models/member_role.rb b/app/models/member_role.rb
index 508475948..3be525363 100644
--- a/app/models/member_role.rb
+++ b/app/models/member_role.rb
@@ -26,7 +26,6 @@ class MemberRole < ActiveRecord::Base
validates_presence_of :role
validate :validate_role_member
- attr_protected :id
def validate_role_member
errors.add :role_id, :invalid if role && !role.member?
diff --git a/app/models/message.rb b/app/models/message.rb
index 65ae3148a..758095289 100644
--- a/app/models/message.rb
+++ b/app/models/message.rb
@@ -22,7 +22,6 @@ class Message < ActiveRecord::Base
acts_as_tree :counter_cache => :replies_count, :order => "#{Message.table_name}.created_on ASC"
acts_as_attachable
belongs_to :last_reply, :class_name => 'Message'
- attr_protected :id
acts_as_searchable :columns => ['subject', 'content'],
:preload => {:board => :project},
@@ -69,9 +68,9 @@ class Message < ActiveRecord::Base
end
def update_messages_board
- if board_id_changed?
+ if saved_change_to_board_id?
Message.where(["id = ? OR parent_id = ?", root.id, root.id]).update_all({:board_id => board_id})
- Board.reset_counters!(board_id_was)
+ Board.reset_counters!(board_id_before_last_save)
Board.reset_counters!(board_id)
end
end
diff --git a/app/models/news.rb b/app/models/news.rb
index 7d900d331..8243bc301 100644
--- a/app/models/news.rb
+++ b/app/models/news.rb
@@ -24,7 +24,6 @@ class News < ActiveRecord::Base
validates_presence_of :title, :description
validates_length_of :title, :maximum => 60
validates_length_of :summary, :maximum => 255
- attr_protected :id
acts_as_attachable :edit_permission => :manage_news,
:delete_permission => :manage_news
diff --git a/app/models/project.rb b/app/models/project.rb
index 7e4f4ce50..3162676b6 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -67,8 +67,6 @@ class Project < ActiveRecord::Base
:url => Proc.new {|o| {:controller => 'projects', :action => 'show', :id => o}},
:author => nil
- attr_protected :status
-
validates_presence_of :name, :identifier
validates_uniqueness_of :identifier, :if => Proc.new {|p| p.identifier_changed?}
validates_length_of :name, :maximum => 255
@@ -80,9 +78,9 @@ class Project < ActiveRecord::Base
validates_exclusion_of :identifier, :in => %w( new )
validate :validate_parent
- after_save :update_inherited_members, :if => Proc.new {|project| project.inherit_members_changed?}
- after_save :remove_inherited_member_roles, :add_inherited_member_roles, :if => Proc.new {|project| project.parent_id_changed?}
- after_update :update_versions_from_hierarchy_change, :if => Proc.new {|project| project.parent_id_changed?}
+ after_save :update_inherited_members, :if => Proc.new {|project| project.saved_change_to_inherit_members?}
+ after_save :remove_inherited_member_roles, :add_inherited_member_roles, :if => Proc.new {|project| project.saved_change_to_parent_id?}
+ after_update :update_versions_from_hierarchy_change, :if => Proc.new {|project| project.saved_change_to_parent_id?}
before_destroy :delete_all_members
scope :has_module, lambda {|mod|
@@ -257,6 +255,15 @@ class Project < ActiveRecord::Base
scope
end
+ # Creates or updates project time entry activities
+ def update_or_create_time_entry_activities(activities)
+ transaction do
+ activities.each do |id, activity|
+ update_or_create_time_entry_activity(id, activity)
+ end
+ end
+ end
+
# Will create a new Project specific Activity or update an existing one
#
# This will raise a ActiveRecord::Rollback if the TimeEntryActivity
@@ -776,6 +783,10 @@ class Project < ActiveRecord::Base
:if => lambda {|project, user| project.parent.nil? || project.parent.visible?(user)}
def safe_attributes=(attrs, user=User.current)
+ if attrs.respond_to?(:to_unsafe_hash)
+ attrs = attrs.to_unsafe_hash
+ end
+
return unless attrs.is_a?(Hash)
attrs = attrs.deep_dup
@@ -872,10 +883,10 @@ class Project < ActiveRecord::Base
def update_inherited_members
if parent
- if inherit_members? && !inherit_members_was
+ if inherit_members? && !inherit_members_before_last_save
remove_inherited_member_roles
add_inherited_member_roles
- elsif !inherit_members? && inherit_members_was
+ elsif !inherit_members? && inherit_members_before_last_save
remove_inherited_member_roles
end
end
diff --git a/app/models/query.rb b/app/models/query.rb
index 02e808eca..fc6f97a6c 100644
--- a/app/models/query.rb
+++ b/app/models/query.rb
@@ -212,8 +212,6 @@ class Query < ActiveRecord::Base
serialize :sort_criteria, Array
serialize :options, Hash
- attr_protected :project_id, :user_id
-
validates_presence_of :name
validates_length_of :name, :maximum => 255
validates :visibility, :inclusion => { :in => [VISIBILITY_PUBLIC, VISIBILITY_ROLES, VISIBILITY_PRIVATE] }
@@ -223,7 +221,7 @@ class Query < ActiveRecord::Base
end
after_save do |query|
- if query.visibility_changed? && query.visibility != VISIBILITY_ROLES
+ if query.saved_change_to_visibility? && query.visibility != VISIBILITY_ROLES
query.roles.clear
end
end
@@ -623,7 +621,7 @@ class Query < ActiveRecord::Base
# Add multiple filters using +add_filter+
def add_filters(fields, operators, values)
- if fields.is_a?(Array) && operators.is_a?(Hash) && (values.nil? || values.is_a?(Hash))
+ if fields.present? && operators.present?
fields.each do |field|
add_filter(field, operators[field], values && values[field])
end
diff --git a/app/models/repository.rb b/app/models/repository.rb
index fd3a9fbf6..b3886d536 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -48,7 +48,6 @@ class Repository < ActiveRecord::Base
# Checks if the SCM is enabled when creating a repository
validate :repo_create_validation, :on => :create
validate :validate_repository_path
- attr_protected :id
safe_attributes 'identifier',
'login',
diff --git a/app/models/repository/bazaar.rb b/app/models/repository/bazaar.rb
index 9cc84daa0..431565dfb 100644
--- a/app/models/repository/bazaar.rb
+++ b/app/models/repository/bazaar.rb
@@ -18,7 +18,6 @@
require 'redmine/scm/adapters/bazaar_adapter'
class Repository::Bazaar < Repository
- attr_protected :root_url
validates_presence_of :url, :log_encoding
def self.human_attribute_name(attribute_key_name, *args)
diff --git a/app/models/repository/filesystem.rb b/app/models/repository/filesystem.rb
index 0a612ae8e..0b370f39e 100644
--- a/app/models/repository/filesystem.rb
+++ b/app/models/repository/filesystem.rb
@@ -21,7 +21,6 @@
require 'redmine/scm/adapters/filesystem_adapter'
class Repository::Filesystem < Repository
- attr_protected :root_url
validates_presence_of :url
def self.human_attribute_name(attribute_key_name, *args)
diff --git a/app/models/repository/git.rb b/app/models/repository/git.rb
index 893dc533d..4cb16e524 100644
--- a/app/models/repository/git.rb
+++ b/app/models/repository/git.rb
@@ -19,7 +19,6 @@
require 'redmine/scm/adapters/git_adapter'
class Repository::Git < Repository
- attr_protected :root_url
validates_presence_of :url
safe_attributes 'report_last_commit'
diff --git a/app/models/repository/mercurial.rb b/app/models/repository/mercurial.rb
index b9a767fec..922893a6a 100644
--- a/app/models/repository/mercurial.rb
+++ b/app/models/repository/mercurial.rb
@@ -23,7 +23,6 @@ class Repository::Mercurial < Repository
lambda {order("#{Changeset.table_name}.id DESC")},
:foreign_key => 'repository_id'
- attr_protected :root_url
validates_presence_of :url
# number of changesets to fetch at once
diff --git a/app/models/repository/subversion.rb b/app/models/repository/subversion.rb
index 70d497771..bc4e9f2e8 100644
--- a/app/models/repository/subversion.rb
+++ b/app/models/repository/subversion.rb
@@ -18,7 +18,6 @@
require 'redmine/scm/adapters/subversion_adapter'
class Repository::Subversion < Repository
- attr_protected :root_url
validates_presence_of :url
validates_format_of :url, :with => %r{\A(http|https|svn(\+[^\s:\/\\]+)?|file):\/\/.+}i
diff --git a/app/models/role.rb b/app/models/role.rb
index 8bd2e7258..cdd8fd394 100644
--- a/app/models/role.rb
+++ b/app/models/role.rb
@@ -77,7 +77,6 @@ class Role < ActiveRecord::Base
serialize :permissions, ::Role::PermissionsAttributeCoder
store :settings, :accessors => [:permissions_all_trackers, :permissions_tracker_ids]
- attr_protected :builtin
validates_presence_of :name
validates_uniqueness_of :name
diff --git a/app/models/setting.rb b/app/models/setting.rb
index 6e702505e..b73aae4f2 100644
--- a/app/models/setting.rb
+++ b/app/models/setting.rb
@@ -82,7 +82,6 @@ class Setting < ActiveRecord::Base
validates_numericality_of :value, :only_integer => true, :if => Proc.new { |setting|
(s = available_settings[setting.name]) && s['format'] == 'int'
}
- attr_protected :id
# Hash used to cache setting values
@cached_settings = {}
diff --git a/app/models/time_entry.rb b/app/models/time_entry.rb
index 80d14ad15..d64c311fa 100644
--- a/app/models/time_entry.rb
+++ b/app/models/time_entry.rb
@@ -24,8 +24,6 @@ class TimeEntry < ActiveRecord::Base
belongs_to :user
belongs_to :activity, :class_name => 'TimeEntryActivity'
- attr_protected :user_id, :tyear, :tmonth, :tweek
-
acts_as_customizable
acts_as_event :title => Proc.new { |o|
related = o.issue if o.issue && o.issue.visible?
diff --git a/app/models/token.rb b/app/models/token.rb
index ee43865c1..5990056f5 100644
--- a/app/models/token.rb
+++ b/app/models/token.rb
@@ -18,7 +18,6 @@
class Token < ActiveRecord::Base
belongs_to :user
validates_uniqueness_of :value
- attr_protected :id
before_create :delete_previous_tokens, :generate_new_token
diff --git a/app/models/tracker.rb b/app/models/tracker.rb
index 59263214f..9524a620c 100644
--- a/app/models/tracker.rb
+++ b/app/models/tracker.rb
@@ -37,8 +37,6 @@ class Tracker < ActiveRecord::Base
has_and_belongs_to_many :custom_fields, :class_name => 'IssueCustomField', :join_table => "#{table_name_prefix}custom_fields_trackers#{table_name_suffix}", :association_foreign_key => 'custom_field_id'
acts_as_positioned
- attr_protected :fields_bits
-
validates_presence_of :default_status
validates_presence_of :name
validates_uniqueness_of :name
diff --git a/app/models/user.rb b/app/models/user.rb
index 62a0289f0..7cdf78678 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -99,9 +99,6 @@ class User < Principal
attr_accessor :last_before_login_on
attr_accessor :remote_ip
- # Prevents unauthorized assignments
- attr_protected :password, :password_confirmation, :hashed_password
-
LOGIN_LENGTH_LIMIT = 60
MAIL_LENGTH_LIMIT = 60
@@ -771,9 +768,9 @@ class User < Principal
case mail_notification
when 'selected', 'only_my_events'
# user receives notifications for created/assigned issues on unselected projects
- object.author == self || is_or_belongs_to?(object.assigned_to) || is_or_belongs_to?(object.assigned_to_was)
+ object.author == self || is_or_belongs_to?(object.assigned_to) || is_or_belongs_to?(object.previous_assignee)
when 'only_assigned'
- is_or_belongs_to?(object.assigned_to) || is_or_belongs_to?(object.assigned_to_was)
+ is_or_belongs_to?(object.assigned_to) || is_or_belongs_to?(object.previous_assignee)
when 'only_owner'
object.author == self
end
@@ -845,7 +842,7 @@ class User < Principal
# This helps to keep the account secure in case the associated email account
# was compromised.
def destroy_tokens
- if hashed_password_changed? || (status_changed? && !active?)
+ if saved_change_to_hashed_password? || (saved_change_to_status? && !active?)
tokens = ['recovery', 'autologin', 'session']
Token.where(:user_id => id, :action => tokens).delete_all
end
@@ -900,16 +897,16 @@ class User < Principal
}
deliver = false
- if (admin? && id_changed? && active?) || # newly created admin
- (admin? && admin_changed? && active?) || # regular user became admin
- (admin? && status_changed? && active?) # locked admin became active again
+ if (admin? && saved_change_to_id? && active?) || # newly created admin
+ (admin? && saved_change_to_admin? && active?) || # regular user became admin
+ (admin? && saved_change_to_status? && active?) # locked admin became active again
deliver = true
options[:message] = :mail_body_security_notification_add
elsif (admin? && destroyed? && active?) || # active admin user was deleted
- (!admin? && admin_changed? && active?) || # admin is no longer admin
- (admin? && status_changed? && !active?) # admin was locked
+ (!admin? && saved_change_to_admin? && active?) || # admin is no longer admin
+ (admin? && saved_change_to_status? && !active?) # admin was locked
deliver = true
options[:message] = :mail_body_security_notification_remove
diff --git a/app/models/user_preference.rb b/app/models/user_preference.rb
index c6b7fc2ac..1bf60c7f6 100644
--- a/app/models/user_preference.rb
+++ b/app/models/user_preference.rb
@@ -21,8 +21,6 @@ class UserPreference < ActiveRecord::Base
belongs_to :user
serialize :others
- attr_protected :others, :user_id
-
before_save :set_others_hash, :clear_unused_block_settings
safe_attributes 'hide_mail',
diff --git a/app/models/version.rb b/app/models/version.rb
index b48938913..4c559dcad 100644
--- a/app/models/version.rb
+++ b/app/models/version.rb
@@ -39,7 +39,6 @@ class Version < ActiveRecord::Base
validates :effective_date, :date => true
validates_inclusion_of :status, :in => VERSION_STATUSES
validates_inclusion_of :sharing, :in => VERSION_SHARINGS
- attr_protected :id
scope :named, lambda {|arg| where("LOWER(#{table_name}.name) = LOWER(?)", arg.to_s.strip)}
scope :like, lambda {|arg|
@@ -302,10 +301,10 @@ class Version < ActiveRecord::Base
# Update the issue's fixed versions. Used if a version's sharing changes.
def update_issues_from_sharing_change
- if sharing_changed?
- if VERSION_SHARINGS.index(sharing_was).nil? ||
+ if saved_change_to_sharing?
+ if VERSION_SHARINGS.index(sharing_before_last_save).nil? ||
VERSION_SHARINGS.index(sharing).nil? ||
- VERSION_SHARINGS.index(sharing_was) > VERSION_SHARINGS.index(sharing)
+ VERSION_SHARINGS.index(sharing_before_last_save) > VERSION_SHARINGS.index(sharing)
Issue.update_versions_from_sharing_change self
end
end
diff --git a/app/models/watcher.rb b/app/models/watcher.rb
index 6198ceffc..30118845b 100644
--- a/app/models/watcher.rb
+++ b/app/models/watcher.rb
@@ -22,7 +22,6 @@ class Watcher < ActiveRecord::Base
validates_presence_of :user
validates_uniqueness_of :user_id, :scope => [:watchable_type, :watchable_id]
validate :validate_user
- attr_protected :id
# Returns true if at least one object among objects is watched by user
def self.any_watched?(objects, user)
diff --git a/app/models/wiki.rb b/app/models/wiki.rb
index 9ed9554cb..683fa24f3 100644
--- a/app/models/wiki.rb
+++ b/app/models/wiki.rb
@@ -26,7 +26,6 @@ class Wiki < ActiveRecord::Base
validates_presence_of :start_page
validates_format_of :start_page, :with => /\A[^,\.\/\?\;\|\:]*\z/
validates_length_of :start_page, maximum: 255
- attr_protected :id
before_destroy :delete_redirects
diff --git a/app/models/wiki_content.rb b/app/models/wiki_content.rb
index 3d992f8f7..0de717cd4 100644
--- a/app/models/wiki_content.rb
+++ b/app/models/wiki_content.rb
@@ -23,7 +23,6 @@ class WikiContent < ActiveRecord::Base
belongs_to :author, :class_name => 'User'
validates_presence_of :text
validates_length_of :comments, :maximum => 1024, :allow_nil => true
- attr_protected :id
acts_as_versioned
@@ -60,7 +59,6 @@ class WikiContent < ActiveRecord::Base
class Version
belongs_to :page, :class_name => '::WikiPage'
belongs_to :author, :class_name => '::User'
- attr_protected :data
acts_as_event :title => Proc.new {|o| "#{l(:label_wiki_edit)}: #{o.page.title} (##{o.version})"},
:description => :comments,
@@ -161,11 +159,11 @@ class WikiContent < ActiveRecord::Base
def send_notification
# new_record? returns false in after_save callbacks
- if id_changed?
+ if saved_change_to_id?
if Setting.notified_events.include?('wiki_content_added')
Mailer.wiki_content_added(self).deliver
end
- elsif text_changed?
+ elsif saved_change_to_text?
if Setting.notified_events.include?('wiki_content_updated')
Mailer.wiki_content_updated(self).deliver
end
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb
index d7b09f357..6e4cf0c03 100644
--- a/app/models/wiki_page.rb
+++ b/app/models/wiki_page.rb
@@ -47,7 +47,6 @@ class WikiPage < ActiveRecord::Base
validates_uniqueness_of :title, :scope => :wiki_id, :case_sensitive => false
validates_length_of :title, maximum: 255
validates_associated :content
- attr_protected :id
validate :validate_parent_title
before_destroy :delete_redirects
@@ -80,6 +79,10 @@ class WikiPage < ActiveRecord::Base
end
def safe_attributes=(attrs, user=User.current)
+ if attrs.respond_to?(:to_unsafe_hash)
+ attrs = attrs.to_unsafe_hash
+ end
+
return unless attrs.is_a?(Hash)
attrs = attrs.deep_dup
@@ -122,7 +125,7 @@ class WikiPage < ActiveRecord::Base
# Moves child pages if page was moved
def handle_children_move
- if !new_record? && wiki_id_changed?
+ if !new_record? && saved_change_to_wiki_id?
children.each do |child|
child.wiki_id = wiki_id
child.redirect_existing_links = redirect_existing_links
diff --git a/app/models/wiki_redirect.rb b/app/models/wiki_redirect.rb
index eb4de869a..79e96abee 100644
--- a/app/models/wiki_redirect.rb
+++ b/app/models/wiki_redirect.rb
@@ -20,7 +20,6 @@ class WikiRedirect < ActiveRecord::Base
validates_presence_of :wiki_id, :title, :redirects_to
validates_length_of :title, :redirects_to, :maximum => 255
- attr_protected :id
before_save :set_redirects_to_wiki_id
diff --git a/app/models/workflow_rule.rb b/app/models/workflow_rule.rb
index 8872d84c6..c4cbf1508 100644
--- a/app/models/workflow_rule.rb
+++ b/app/models/workflow_rule.rb
@@ -24,7 +24,6 @@ class WorkflowRule < ActiveRecord::Base
belongs_to :new_status, :class_name => 'IssueStatus'
validates_presence_of :role, :tracker
- attr_protected :id
# Copies workflows from source to targets
def self.copy(source_tracker, source_role, target_trackers, target_roles)
diff --git a/app/views/welcome/robots.html.erb b/app/views/welcome/robots.text.erb
index 10b540935..10b540935 100644
--- a/app/views/welcome/robots.html.erb
+++ b/app/views/welcome/robots.text.erb
diff --git a/config/application.rb b/config/application.rb
index e1a416ae7..cb848bee6 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -47,13 +47,6 @@ module RedmineApp
# Do not include all helpers
config.action_controller.include_all_helpers = false
- # Do not suppress errors in after_rollback and after_commit callbacks
- config.active_record.raise_in_transactional_callbacks = true
-
- # XML parameter parser removed from core in Rails 4.0
- # and extracted to actionpack-xml_parser gem
- config.middleware.insert_after ActionDispatch::ParamsParser, ActionDispatch::XmlParamsParser
-
# Sets the Content-Length header on responses with fixed-length bodies
config.middleware.insert_after Rack::Sendfile, Rack::ContentLength
diff --git a/config/initializers/10-patches.rb b/config/initializers/10-patches.rb
index 2693f83f4..13efe0cb5 100644
--- a/config/initializers/10-patches.rb
+++ b/config/initializers/10-patches.rb
@@ -27,6 +27,30 @@ module ActiveRecord
end
end
class Relation ; undef open ; end
+
+ # Workaround for a Rails 5.1 regression that breaks queries with a condition
+ # on a table that has a column with the same name as the table
+ # (eg. comments.comments). It breaks has_many associations to these tables as well.
+ # https://github.com/rails/rails/commit/c6a62dc327c54baec87306f5c381e13cacc00a19
+ #
+ # Examples (without the following workaround applied):
+ # Comment.where(:comments => {:id => 1})
+ # TypeError: can't cast Hash
+ #
+ # News.first.comments.count
+ # TypeError: can't cast Hash
+ class PredicateBuilder
+
+ protected
+ alias :create_binds_for_hash_without_comments_fix :create_binds_for_hash
+ def create_binds_for_hash(attributes)
+ if attributes["comments"].is_a?(Hash)
+ return create_binds_for_hash_without_comments_fix attributes["comments"]
+ else
+ create_binds_for_hash_without_comments_fix attributes
+ end
+ end
+ end
end
module ActionView
@@ -201,7 +225,7 @@ module ActionView
unless asset_id.blank?
source += "?#{asset_id}"
end
- asset_path(source, options)
+ asset_path(source, options.merge(skip_pipeline: true))
end
alias :path_to_asset :asset_path_with_asset_id
@@ -218,7 +242,7 @@ module ActionView
if File.exist? path
exist = true
else
- path = File.join(Rails.public_path, compute_asset_path("#{source}#{extname}", options))
+ path = File.join(Rails.public_path, public_compute_asset_path("#{source}#{extname}", options))
if File.exist? path
exist = true
end
diff --git a/config/initializers/20-mime_types.rb b/config/initializers/20-mime_types.rb
index cfd35a3e9..092e3992d 100644
--- a/config/initializers/20-mime_types.rb
+++ b/config/initializers/20-mime_types.rb
@@ -1,4 +1 @@
# Add new mime types for use in respond_to blocks:
-
-Mime::SET << Mime::CSV unless Mime::SET.include?(Mime::CSV)
-
diff --git a/config/routes.rb b/config/routes.rb
index d28b6afa1..a08ca1094 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -242,10 +242,6 @@ Rails.application.routes.draw do
get 'projects/:id/repository/:repository_id/statistics', :to => 'repositories#stats'
get 'projects/:id/repository/:repository_id/graph', :to => 'repositories#graph'
- get 'projects/:id/repository/:repository_id/changes(/*path)',
- :to => 'repositories#changes',
- :format => false
-
get 'projects/:id/repository/:repository_id/revisions/:rev', :to => 'repositories#revision'
get 'projects/:id/repository/:repository_id/revision', :to => 'repositories#revision'
post 'projects/:id/repository/:repository_id/revisions/:rev/issues', :to => 'repositories#add_related_issue'
@@ -255,17 +251,13 @@ Rails.application.routes.draw do
get "projects/:id/repository/:repository_id/revisions/:rev/#{action}(/*path)",
:controller => 'repositories',
:action => action,
- :format => false,
- :constraints => {:rev => /[a-z0-9\.\-_]+/}
+ :format => 'html',
+ :constraints => {:rev => /[a-z0-9\.\-_]+/, :path => /.*/}
end
get 'projects/:id/repository/statistics', :to => 'repositories#stats'
get 'projects/:id/repository/graph', :to => 'repositories#graph'
- get 'projects/:id/repository/changes(/*path)',
- :to => 'repositories#changes',
- :format => false
-
get 'projects/:id/repository/revisions', :to => 'repositories#revisions'
get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision'
get 'projects/:id/repository/revision', :to => 'repositories#revision'
@@ -275,30 +267,32 @@ Rails.application.routes.draw do
get "projects/:id/repository/revisions/:rev/#{action}(/*path)",
:controller => 'repositories',
:action => action,
- :format => false,
- :constraints => {:rev => /[a-z0-9\.\-_]+/}
+ :format => 'html',
+ :constraints => {:rev => /[a-z0-9\.\-_]+/, :path => /.*/}
end
%w(browse entry raw changes annotate diff).each do |action|
get "projects/:id/repository/:repository_id/#{action}(/*path)",
:controller => 'repositories',
:action => action,
- :format => false
+ :format => 'html',
+ :constraints => {:path => /.*/}
end
%w(browse entry raw changes annotate diff).each do |action|
get "projects/:id/repository/#{action}(/*path)",
:controller => 'repositories',
:action => action,
- :format => false
+ :format => 'html',
+ :constraints => {:path => /.*/}
end
- get 'projects/:id/repository/:repository_id/show/*path', :to => 'repositories#show', :format => false
- get 'projects/:id/repository/show/*path', :to => 'repositories#show', :format => false
+ get 'projects/:id/repository/:repository_id/show/*path', :to => 'repositories#show', :format => 'html', :constraints => {:path => /.*/}
+ get 'projects/:id/repository/show/*path', :to => 'repositories#show', :format => 'html', :constraints => {:path => /.*/}
get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil
get 'projects/:id/repository', :to => 'repositories#show', :path => nil
# additional routes for having the file name at the end of url
- get 'attachments/:id/:filename', :to => 'attachments#show', :id => /\d+/, :filename => /.*/, :as => 'named_attachment'
+ get 'attachments/:id/:filename', :to => 'attachments#show', :id => /\d+/, :filename => /.*/, :as => 'named_attachment', :format => 'html'
get 'attachments/download/:id/:filename', :to => 'attachments#download', :id => /\d+/, :filename => /.*/, :as => 'download_named_attachment'
get 'attachments/download/:id', :to => 'attachments#download', :id => /\d+/
get 'attachments/thumbnail/:id(/:size)', :to => 'attachments#thumbnail', :id => /\d+/, :size => /\d+/, :as => 'thumbnail'
@@ -376,7 +370,7 @@ Rails.application.routes.draw do
match 'uploads', :to => 'attachments#upload', :via => :post
- get 'robots.txt', :to => 'welcome#robots'
+ get 'robots', :to => 'welcome#robots'
Dir.glob File.expand_path("#{Redmine::Plugin.directory}/*") do |plugin_dir|
file = File.join(plugin_dir, "config/routes.rb")
diff --git a/db/migrate/001_setup.rb b/db/migrate/001_setup.rb
index 15d783c45..1cd569403 100644
--- a/db/migrate/001_setup.rb
+++ b/db/migrate/001_setup.rb
@@ -15,10 +15,9 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-class Setup < ActiveRecord::Migration
+class Setup < ActiveRecord::Migration[4.2]
class User < ActiveRecord::Base
- attr_protected :id
end
# model removed
diff --git a/db/migrate/002_issue_move.rb b/db/migrate/002_issue_move.rb
index 98e95d3b9..d5966f04e 100644
--- a/db/migrate/002_issue_move.rb
+++ b/db/migrate/002_issue_move.rb
@@ -1,4 +1,4 @@
-class IssueMove < ActiveRecord::Migration
+class IssueMove < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
diff --git a/db/migrate/003_issue_add_note.rb b/db/migrate/003_issue_add_note.rb
index dabdb858f..9f899a80f 100644
--- a/db/migrate/003_issue_add_note.rb
+++ b/db/migrate/003_issue_add_note.rb
@@ -1,4 +1,4 @@
-class IssueAddNote < ActiveRecord::Migration
+class IssueAddNote < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
diff --git a/db/migrate/004_export_pdf.rb b/db/migrate/004_export_pdf.rb
index 8d4ba0b3a..ac7ef2627 100644
--- a/db/migrate/004_export_pdf.rb
+++ b/db/migrate/004_export_pdf.rb
@@ -1,4 +1,4 @@
-class ExportPdf < ActiveRecord::Migration
+class ExportPdf < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
diff --git a/db/migrate/005_issue_start_date.rb b/db/migrate/005_issue_start_date.rb
index 3d1693fc6..93decfb35 100644
--- a/db/migrate/005_issue_start_date.rb
+++ b/db/migrate/005_issue_start_date.rb
@@ -1,4 +1,4 @@
-class IssueStartDate < ActiveRecord::Migration
+class IssueStartDate < ActiveRecord::Migration[4.2]
def self.up
add_column :issues, :start_date, :date
add_column :issues, :done_ratio, :integer, :default => 0, :null => false
diff --git a/db/migrate/006_calendar_and_activity.rb b/db/migrate/006_calendar_and_activity.rb
index a30979a21..3ff204c62 100644
--- a/db/migrate/006_calendar_and_activity.rb
+++ b/db/migrate/006_calendar_and_activity.rb
@@ -1,4 +1,4 @@
-class CalendarAndActivity < ActiveRecord::Migration
+class CalendarAndActivity < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
diff --git a/db/migrate/007_create_journals.rb b/db/migrate/007_create_journals.rb
index 63bdd2374..0d1201406 100644
--- a/db/migrate/007_create_journals.rb
+++ b/db/migrate/007_create_journals.rb
@@ -1,4 +1,4 @@
-class CreateJournals < ActiveRecord::Migration
+class CreateJournals < ActiveRecord::Migration[4.2]
# model removed, but needed for data migration
class IssueHistory < ActiveRecord::Base; belongs_to :issue; end
diff --git a/db/migrate/008_create_user_preferences.rb b/db/migrate/008_create_user_preferences.rb
index 80ae1cdf9..b782b179e 100644
--- a/db/migrate/008_create_user_preferences.rb
+++ b/db/migrate/008_create_user_preferences.rb
@@ -1,4 +1,4 @@
-class CreateUserPreferences < ActiveRecord::Migration
+class CreateUserPreferences < ActiveRecord::Migration[4.2]
def self.up
create_table :user_preferences do |t|
t.column "user_id", :integer, :default => 0, :null => false
diff --git a/db/migrate/009_add_hide_mail_pref.rb b/db/migrate/009_add_hide_mail_pref.rb
index a22eafd93..8dd3399c9 100644
--- a/db/migrate/009_add_hide_mail_pref.rb
+++ b/db/migrate/009_add_hide_mail_pref.rb
@@ -1,4 +1,4 @@
-class AddHideMailPref < ActiveRecord::Migration
+class AddHideMailPref < ActiveRecord::Migration[4.2]
def self.up
add_column :user_preferences, :hide_mail, :boolean, :default => false
end
diff --git a/db/migrate/010_create_comments.rb b/db/migrate/010_create_comments.rb
index 29e1116af..c711c748a 100644
--- a/db/migrate/010_create_comments.rb
+++ b/db/migrate/010_create_comments.rb
@@ -1,4 +1,4 @@
-class CreateComments < ActiveRecord::Migration
+class CreateComments < ActiveRecord::Migration[4.2]
def self.up
create_table :comments do |t|
t.column :commented_type, :string, :limit => 30, :default => "", :null => false
diff --git a/db/migrate/011_add_news_comments_count.rb b/db/migrate/011_add_news_comments_count.rb
index a24743999..01a283345 100644
--- a/db/migrate/011_add_news_comments_count.rb
+++ b/db/migrate/011_add_news_comments_count.rb
@@ -1,4 +1,4 @@
-class AddNewsCommentsCount < ActiveRecord::Migration
+class AddNewsCommentsCount < ActiveRecord::Migration[4.2]
def self.up
add_column :news, :comments_count, :integer, :default => 0, :null => false
end
diff --git a/db/migrate/012_add_comments_permissions.rb b/db/migrate/012_add_comments_permissions.rb
index 91eed6443..e82fb89e9 100644
--- a/db/migrate/012_add_comments_permissions.rb
+++ b/db/migrate/012_add_comments_permissions.rb
@@ -1,4 +1,4 @@
-class AddCommentsPermissions < ActiveRecord::Migration
+class AddCommentsPermissions < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
diff --git a/db/migrate/013_create_queries.rb b/db/migrate/013_create_queries.rb
index e0e8c90c0..578472590 100644
--- a/db/migrate/013_create_queries.rb
+++ b/db/migrate/013_create_queries.rb
@@ -1,4 +1,4 @@
-class CreateQueries < ActiveRecord::Migration
+class CreateQueries < ActiveRecord::Migration[4.2]
def self.up
create_table :queries, :force => true do |t|
t.column "project_id", :integer
diff --git a/db/migrate/014_add_queries_permissions.rb b/db/migrate/014_add_queries_permissions.rb
index ae1f2455d..07f974900 100644
--- a/db/migrate/014_add_queries_permissions.rb
+++ b/db/migrate/014_add_queries_permissions.rb
@@ -1,4 +1,4 @@
-class AddQueriesPermissions < ActiveRecord::Migration
+class AddQueriesPermissions < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
diff --git a/db/migrate/015_create_repositories.rb b/db/migrate/015_create_repositories.rb
index d8c0524b3..e8e92bdb9 100644
--- a/db/migrate/015_create_repositories.rb
+++ b/db/migrate/015_create_repositories.rb
@@ -1,4 +1,4 @@
-class CreateRepositories < ActiveRecord::Migration
+class CreateRepositories < ActiveRecord::Migration[4.2]
def self.up
create_table :repositories, :force => true do |t|
t.column "project_id", :integer, :default => 0, :null => false
diff --git a/db/migrate/016_add_repositories_permissions.rb b/db/migrate/016_add_repositories_permissions.rb
index 9fcddb09c..217df3cae 100644
--- a/db/migrate/016_add_repositories_permissions.rb
+++ b/db/migrate/016_add_repositories_permissions.rb
@@ -1,4 +1,4 @@
-class AddRepositoriesPermissions < ActiveRecord::Migration
+class AddRepositoriesPermissions < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
diff --git a/db/migrate/017_create_settings.rb b/db/migrate/017_create_settings.rb
index 99f96adf8..777e36ed6 100644
--- a/db/migrate/017_create_settings.rb
+++ b/db/migrate/017_create_settings.rb
@@ -1,4 +1,4 @@
-class CreateSettings < ActiveRecord::Migration
+class CreateSettings < ActiveRecord::Migration[4.2]
def self.up
create_table :settings, :force => true do |t|
t.column "name", :string, :limit => 30, :default => "", :null => false
diff --git a/db/migrate/018_set_doc_and_files_notifications.rb b/db/migrate/018_set_doc_and_files_notifications.rb
index f260bebc6..aca687385 100644
--- a/db/migrate/018_set_doc_and_files_notifications.rb
+++ b/db/migrate/018_set_doc_and_files_notifications.rb
@@ -1,4 +1,4 @@
-class SetDocAndFilesNotifications < ActiveRecord::Migration
+class SetDocAndFilesNotifications < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
diff --git a/db/migrate/019_add_issue_status_position.rb b/db/migrate/019_add_issue_status_position.rb
index 012f97c22..1536bdd0a 100644
--- a/db/migrate/019_add_issue_status_position.rb
+++ b/db/migrate/019_add_issue_status_position.rb
@@ -1,4 +1,4 @@
-class AddIssueStatusPosition < ActiveRecord::Migration
+class AddIssueStatusPosition < ActiveRecord::Migration[4.2]
def self.up
add_column :issue_statuses, :position, :integer, :default => 1
IssueStatus.all.each_with_index {|status, i| status.update_attribute(:position, i+1)}
diff --git a/db/migrate/020_add_role_position.rb b/db/migrate/020_add_role_position.rb
index 48ac89a36..39a678e1a 100644
--- a/db/migrate/020_add_role_position.rb
+++ b/db/migrate/020_add_role_position.rb
@@ -1,4 +1,4 @@
-class AddRolePosition < ActiveRecord::Migration
+class AddRolePosition < ActiveRecord::Migration[4.2]
def self.up
add_column :roles, :position, :integer, :default => 1
Role.all.each_with_index {|role, i| role.update_attribute(:position, i+1)}
diff --git a/db/migrate/021_add_tracker_position.rb b/db/migrate/021_add_tracker_position.rb
index 5fa8a3185..dca65d109 100644
--- a/db/migrate/021_add_tracker_position.rb
+++ b/db/migrate/021_add_tracker_position.rb
@@ -1,4 +1,4 @@
-class AddTrackerPosition < ActiveRecord::Migration
+class AddTrackerPosition < ActiveRecord::Migration[4.2]
def self.up
add_column :trackers, :position, :integer, :default => 1
Tracker.all.each_with_index {|tracker, i| tracker.update_attribute(:position, i+1)}
diff --git a/db/migrate/022_serialize_possibles_values.rb b/db/migrate/022_serialize_possibles_values.rb
index 3e9fed0a1..66905c9c6 100644
--- a/db/migrate/022_serialize_possibles_values.rb
+++ b/db/migrate/022_serialize_possibles_values.rb
@@ -1,4 +1,4 @@
-class SerializePossiblesValues < ActiveRecord::Migration
+class SerializePossiblesValues < ActiveRecord::Migration[4.2]
def self.up
CustomField.all.each do |field|
if field.possible_values and field.possible_values.is_a? String
diff --git a/db/migrate/023_add_tracker_is_in_roadmap.rb b/db/migrate/023_add_tracker_is_in_roadmap.rb
index 82ef87bba..727b1a803 100644
--- a/db/migrate/023_add_tracker_is_in_roadmap.rb
+++ b/db/migrate/023_add_tracker_is_in_roadmap.rb
@@ -1,4 +1,4 @@
-class AddTrackerIsInRoadmap < ActiveRecord::Migration
+class AddTrackerIsInRoadmap < ActiveRecord::Migration[4.2]
def self.up
add_column :trackers, :is_in_roadmap, :boolean, :default => true, :null => false
end
diff --git a/db/migrate/024_add_roadmap_permission.rb b/db/migrate/024_add_roadmap_permission.rb
index f521e6025..72aeaeded 100644
--- a/db/migrate/024_add_roadmap_permission.rb
+++ b/db/migrate/024_add_roadmap_permission.rb
@@ -1,4 +1,4 @@
-class AddRoadmapPermission < ActiveRecord::Migration
+class AddRoadmapPermission < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
diff --git a/db/migrate/025_add_search_permission.rb b/db/migrate/025_add_search_permission.rb
index 7f1c5c6fc..782eeb286 100644
--- a/db/migrate/025_add_search_permission.rb
+++ b/db/migrate/025_add_search_permission.rb
@@ -1,4 +1,4 @@
-class AddSearchPermission < ActiveRecord::Migration
+class AddSearchPermission < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
diff --git a/db/migrate/026_add_repository_login_and_password.rb b/db/migrate/026_add_repository_login_and_password.rb
index 5fc919725..e26c2333c 100644
--- a/db/migrate/026_add_repository_login_and_password.rb
+++ b/db/migrate/026_add_repository_login_and_password.rb
@@ -1,4 +1,4 @@
-class AddRepositoryLoginAndPassword < ActiveRecord::Migration
+class AddRepositoryLoginAndPassword < ActiveRecord::Migration[4.2]
def self.up
add_column :repositories, :login, :string, :limit => 60, :default => ""
add_column :repositories, :password, :string, :limit => 60, :default => ""
diff --git a/db/migrate/027_create_wikis.rb b/db/migrate/027_create_wikis.rb
index 284eee2e2..c40481488 100644
--- a/db/migrate/027_create_wikis.rb
+++ b/db/migrate/027_create_wikis.rb
@@ -1,4 +1,4 @@
-class CreateWikis < ActiveRecord::Migration
+class CreateWikis < ActiveRecord::Migration[4.2]
def self.up
create_table :wikis do |t|
t.column :project_id, :integer, :null => false
diff --git a/db/migrate/028_create_wiki_pages.rb b/db/migrate/028_create_wiki_pages.rb
index e2282125a..95fd6b59b 100644
--- a/db/migrate/028_create_wiki_pages.rb
+++ b/db/migrate/028_create_wiki_pages.rb
@@ -1,4 +1,4 @@
-class CreateWikiPages < ActiveRecord::Migration
+class CreateWikiPages < ActiveRecord::Migration[4.2]
def self.up
create_table :wiki_pages do |t|
t.column :wiki_id, :integer, :null => false
diff --git a/db/migrate/029_create_wiki_contents.rb b/db/migrate/029_create_wiki_contents.rb
index 5b6a22f94..662488405 100644
--- a/db/migrate/029_create_wiki_contents.rb
+++ b/db/migrate/029_create_wiki_contents.rb
@@ -1,4 +1,4 @@
-class CreateWikiContents < ActiveRecord::Migration
+class CreateWikiContents < ActiveRecord::Migration[4.2]
def self.up
create_table :wiki_contents do |t|
t.column :page_id, :integer, :null => false
diff --git a/db/migrate/030_add_projects_feeds_permissions.rb b/db/migrate/030_add_projects_feeds_permissions.rb
index 866cc39ae..29e31ab14 100644
--- a/db/migrate/030_add_projects_feeds_permissions.rb
+++ b/db/migrate/030_add_projects_feeds_permissions.rb
@@ -1,4 +1,4 @@
-class AddProjectsFeedsPermissions < ActiveRecord::Migration
+class AddProjectsFeedsPermissions < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
diff --git a/db/migrate/031_add_repository_root_url.rb b/db/migrate/031_add_repository_root_url.rb
index df57809c7..96ac761e4 100644
--- a/db/migrate/031_add_repository_root_url.rb
+++ b/db/migrate/031_add_repository_root_url.rb
@@ -1,4 +1,4 @@
-class AddRepositoryRootUrl < ActiveRecord::Migration
+class AddRepositoryRootUrl < ActiveRecord::Migration[4.2]
def self.up
add_column :repositories, :root_url, :string, :limit => 255, :default => ""
end
diff --git a/db/migrate/032_create_time_entries.rb b/db/migrate/032_create_time_entries.rb
index 9b9a54eb1..0e93dca23 100644
--- a/db/migrate/032_create_time_entries.rb
+++ b/db/migrate/032_create_time_entries.rb
@@ -1,4 +1,4 @@
-class CreateTimeEntries < ActiveRecord::Migration
+class CreateTimeEntries < ActiveRecord::Migration[4.2]
def self.up
create_table :time_entries do |t|
t.column :project_id, :integer, :null => false
diff --git a/db/migrate/033_add_timelog_permissions.rb b/db/migrate/033_add_timelog_permissions.rb
index 58e2c436a..42889f1e7 100644
--- a/db/migrate/033_add_timelog_permissions.rb
+++ b/db/migrate/033_add_timelog_permissions.rb
@@ -1,4 +1,4 @@
-class AddTimelogPermissions < ActiveRecord::Migration
+class AddTimelogPermissions < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
diff --git a/db/migrate/034_create_changesets.rb b/db/migrate/034_create_changesets.rb
index 612fd46bb..e0180a041 100644
--- a/db/migrate/034_create_changesets.rb
+++ b/db/migrate/034_create_changesets.rb
@@ -1,4 +1,4 @@
-class CreateChangesets < ActiveRecord::Migration
+class CreateChangesets < ActiveRecord::Migration[4.2]
def self.up
create_table :changesets do |t|
t.column :repository_id, :integer, :null => false
diff --git a/db/migrate/035_create_changes.rb b/db/migrate/035_create_changes.rb
index fa0cfac3f..ed62e4c31 100644
--- a/db/migrate/035_create_changes.rb
+++ b/db/migrate/035_create_changes.rb
@@ -1,4 +1,4 @@
-class CreateChanges < ActiveRecord::Migration
+class CreateChanges < ActiveRecord::Migration[4.2]
def self.up
create_table :changes do |t|
t.column :changeset_id, :integer, :null => false
diff --git a/db/migrate/036_add_changeset_commit_date.rb b/db/migrate/036_add_changeset_commit_date.rb
index b9cc49b84..90ce52466 100644
--- a/db/migrate/036_add_changeset_commit_date.rb
+++ b/db/migrate/036_add_changeset_commit_date.rb
@@ -1,4 +1,4 @@
-class AddChangesetCommitDate < ActiveRecord::Migration
+class AddChangesetCommitDate < ActiveRecord::Migration[4.2]
def self.up
add_column :changesets, :commit_date, :date
Changeset.update_all "commit_date = committed_on"
diff --git a/db/migrate/037_add_project_identifier.rb b/db/migrate/037_add_project_identifier.rb
index 0fd8c7513..de796d6d1 100644
--- a/db/migrate/037_add_project_identifier.rb
+++ b/db/migrate/037_add_project_identifier.rb
@@ -1,4 +1,4 @@
-class AddProjectIdentifier < ActiveRecord::Migration
+class AddProjectIdentifier < ActiveRecord::Migration[4.2]
def self.up
add_column :projects, :identifier, :string, :limit => 20
end
diff --git a/db/migrate/038_add_custom_field_is_filter.rb b/db/migrate/038_add_custom_field_is_filter.rb
index 519ee0bd5..a57c1b036 100644
--- a/db/migrate/038_add_custom_field_is_filter.rb
+++ b/db/migrate/038_add_custom_field_is_filter.rb
@@ -1,4 +1,4 @@
-class AddCustomFieldIsFilter < ActiveRecord::Migration
+class AddCustomFieldIsFilter < ActiveRecord::Migration[4.2]
def self.up
add_column :custom_fields, :is_filter, :boolean, :null => false, :default => false
end
diff --git a/db/migrate/039_create_watchers.rb b/db/migrate/039_create_watchers.rb
index 9579e19a4..d14cea464 100644
--- a/db/migrate/039_create_watchers.rb
+++ b/db/migrate/039_create_watchers.rb
@@ -1,4 +1,4 @@
-class CreateWatchers < ActiveRecord::Migration
+class CreateWatchers < ActiveRecord::Migration[4.2]
def self.up
create_table :watchers do |t|
t.column :watchable_type, :string, :default => "", :null => false
diff --git a/db/migrate/040_create_changesets_issues.rb b/db/migrate/040_create_changesets_issues.rb
index 494d3cc46..d4aad0f01 100644
--- a/db/migrate/040_create_changesets_issues.rb
+++ b/db/migrate/040_create_changesets_issues.rb
@@ -1,4 +1,4 @@
-class CreateChangesetsIssues < ActiveRecord::Migration
+class CreateChangesetsIssues < ActiveRecord::Migration[4.2]
def self.up
create_table :changesets_issues, :id => false do |t|
t.column :changeset_id, :integer, :null => false
diff --git a/db/migrate/041_rename_comment_to_comments.rb b/db/migrate/041_rename_comment_to_comments.rb
index 93677e575..dcf537bbc 100644
--- a/db/migrate/041_rename_comment_to_comments.rb
+++ b/db/migrate/041_rename_comment_to_comments.rb
@@ -1,4 +1,4 @@
-class RenameCommentToComments < ActiveRecord::Migration
+class RenameCommentToComments < ActiveRecord::Migration[4.2]
def self.up
rename_column(:comments, :comment, :comments) if ActiveRecord::Base.connection.columns(Comment.table_name).detect{|c| c.name == "comment"}
rename_column(:wiki_contents, :comment, :comments) if ActiveRecord::Base.connection.columns(WikiContent.table_name).detect{|c| c.name == "comment"}
diff --git a/db/migrate/042_create_issue_relations.rb b/db/migrate/042_create_issue_relations.rb
index 802c12437..98ad24fb0 100644
--- a/db/migrate/042_create_issue_relations.rb
+++ b/db/migrate/042_create_issue_relations.rb
@@ -1,4 +1,4 @@
-class CreateIssueRelations < ActiveRecord::Migration
+class CreateIssueRelations < ActiveRecord::Migration[4.2]
def self.up
create_table :issue_relations do |t|
t.column :issue_from_id, :integer, :null => false
diff --git a/db/migrate/043_add_relations_permissions.rb b/db/migrate/043_add_relations_permissions.rb
index 3c86d7e60..7250606ed 100644
--- a/db/migrate/043_add_relations_permissions.rb
+++ b/db/migrate/043_add_relations_permissions.rb
@@ -1,4 +1,4 @@
-class AddRelationsPermissions < ActiveRecord::Migration
+class AddRelationsPermissions < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
diff --git a/db/migrate/044_set_language_length_to_five.rb b/db/migrate/044_set_language_length_to_five.rb
index a417f7d70..1e600690f 100644
--- a/db/migrate/044_set_language_length_to_five.rb
+++ b/db/migrate/044_set_language_length_to_five.rb
@@ -1,4 +1,4 @@
-class SetLanguageLengthToFive < ActiveRecord::Migration
+class SetLanguageLengthToFive < ActiveRecord::Migration[4.2]
def self.up
change_column :users, :language, :string, :limit => 5, :default => ""
end
diff --git a/db/migrate/045_create_boards.rb b/db/migrate/045_create_boards.rb
index 17f2bbbe2..49b15edcc 100644
--- a/db/migrate/045_create_boards.rb
+++ b/db/migrate/045_create_boards.rb
@@ -1,4 +1,4 @@
-class CreateBoards < ActiveRecord::Migration
+class CreateBoards < ActiveRecord::Migration[4.2]
def self.up
create_table :boards do |t|
t.column :project_id, :integer, :null => false
diff --git a/db/migrate/046_create_messages.rb b/db/migrate/046_create_messages.rb
index d99aaf842..99d39c8d3 100644
--- a/db/migrate/046_create_messages.rb
+++ b/db/migrate/046_create_messages.rb
@@ -1,4 +1,4 @@
-class CreateMessages < ActiveRecord::Migration
+class CreateMessages < ActiveRecord::Migration[4.2]
def self.up
create_table :messages do |t|
t.column :board_id, :integer, :null => false
diff --git a/db/migrate/047_add_boards_permissions.rb b/db/migrate/047_add_boards_permissions.rb
index 1a9f095f7..cf7938e9f 100644
--- a/db/migrate/047_add_boards_permissions.rb
+++ b/db/migrate/047_add_boards_permissions.rb
@@ -1,4 +1,4 @@
-class AddBoardsPermissions < ActiveRecord::Migration
+class AddBoardsPermissions < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
diff --git a/db/migrate/048_allow_null_version_effective_date.rb b/db/migrate/048_allow_null_version_effective_date.rb
index 82d2a33ec..9cce1e3f6 100644
--- a/db/migrate/048_allow_null_version_effective_date.rb
+++ b/db/migrate/048_allow_null_version_effective_date.rb
@@ -1,4 +1,4 @@
-class AllowNullVersionEffectiveDate < ActiveRecord::Migration
+class AllowNullVersionEffectiveDate < ActiveRecord::Migration[4.2]
def self.up
change_column :versions, :effective_date, :date, :default => nil, :null => true
end
diff --git a/db/migrate/049_add_wiki_destroy_page_permission.rb b/db/migrate/049_add_wiki_destroy_page_permission.rb
index 803d357a1..bbeb26d8d 100644
--- a/db/migrate/049_add_wiki_destroy_page_permission.rb
+++ b/db/migrate/049_add_wiki_destroy_page_permission.rb
@@ -1,4 +1,4 @@
-class AddWikiDestroyPagePermission < ActiveRecord::Migration
+class AddWikiDestroyPagePermission < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
diff --git a/db/migrate/050_add_wiki_attachments_permissions.rb b/db/migrate/050_add_wiki_attachments_permissions.rb
index e87a46bb3..fd5f35891 100644
--- a/db/migrate/050_add_wiki_attachments_permissions.rb
+++ b/db/migrate/050_add_wiki_attachments_permissions.rb
@@ -1,4 +1,4 @@
-class AddWikiAttachmentsPermissions < ActiveRecord::Migration
+class AddWikiAttachmentsPermissions < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
diff --git a/db/migrate/051_add_project_status.rb b/db/migrate/051_add_project_status.rb
index fba36d237..e7ceade0b 100644
--- a/db/migrate/051_add_project_status.rb
+++ b/db/migrate/051_add_project_status.rb
@@ -1,4 +1,4 @@
-class AddProjectStatus < ActiveRecord::Migration
+class AddProjectStatus < ActiveRecord::Migration[4.2]
def self.up
add_column :projects, :status, :integer, :default => 1, :null => false
end
diff --git a/db/migrate/052_add_changes_revision.rb b/db/migrate/052_add_changes_revision.rb
index 6f58c1a70..e9b178480 100644
--- a/db/migrate/052_add_changes_revision.rb
+++ b/db/migrate/052_add_changes_revision.rb
@@ -1,4 +1,4 @@
-class AddChangesRevision < ActiveRecord::Migration
+class AddChangesRevision < ActiveRecord::Migration[4.2]
def self.up
add_column :changes, :revision, :string
end
diff --git a/db/migrate/053_add_changes_branch.rb b/db/migrate/053_add_changes_branch.rb
index 998ce2ba5..d8dbcfd05 100644
--- a/db/migrate/053_add_changes_branch.rb
+++ b/db/migrate/053_add_changes_branch.rb
@@ -1,4 +1,4 @@
-class AddChangesBranch < ActiveRecord::Migration
+class AddChangesBranch < ActiveRecord::Migration[4.2]
def self.up
add_column :changes, :branch, :string
end
diff --git a/db/migrate/054_add_changesets_scmid.rb b/db/migrate/054_add_changesets_scmid.rb
index 188fa6ef6..034facb4b 100644
--- a/db/migrate/054_add_changesets_scmid.rb
+++ b/db/migrate/054_add_changesets_scmid.rb
@@ -1,4 +1,4 @@
-class AddChangesetsScmid < ActiveRecord::Migration
+class AddChangesetsScmid < ActiveRecord::Migration[4.2]
def self.up
add_column :changesets, :scmid, :string
end
diff --git a/db/migrate/055_add_repositories_type.rb b/db/migrate/055_add_repositories_type.rb
index f5a71620c..5ee43cb36 100644
--- a/db/migrate/055_add_repositories_type.rb
+++ b/db/migrate/055_add_repositories_type.rb
@@ -1,4 +1,4 @@
-class AddRepositoriesType < ActiveRecord::Migration
+class AddRepositoriesType < ActiveRecord::Migration[4.2]
def self.up
add_column :repositories, :type, :string
# Set class name for existing SVN repositories
diff --git a/db/migrate/056_add_repositories_changes_permission.rb b/db/migrate/056_add_repositories_changes_permission.rb
index 00252db43..71e23be29 100644
--- a/db/migrate/056_add_repositories_changes_permission.rb
+++ b/db/migrate/056_add_repositories_changes_permission.rb
@@ -1,4 +1,4 @@
-class AddRepositoriesChangesPermission < ActiveRecord::Migration
+class AddRepositoriesChangesPermission < ActiveRecord::Migration[4.2]
# model removed
class Permission < ActiveRecord::Base; end
diff --git a/db/migrate/057_add_versions_wiki_page_title.rb b/db/migrate/057_add_versions_wiki_page_title.rb
index 58b8fd9a8..cb2273598 100644
--- a/db/migrate/057_add_versions_wiki_page_title.rb
+++ b/db/migrate/057_add_versions_wiki_page_title.rb
@@ -1,4 +1,4 @@
-class AddVersionsWikiPageTitle < ActiveRecord::Migration
+class AddVersionsWikiPageTitle < ActiveRecord::Migration[4.2]
def self.up
add_column :versions, :wiki_page_title, :string
end
diff --git a/db/migrate/058_add_issue_categories_assigned_to_id.rb b/db/migrate/058_add_issue_categories_assigned_to_id.rb
index 8653532e0..d17afdc9d 100644
--- a/db/migrate/058_add_issue_categories_assigned_to_id.rb
+++ b/db/migrate/058_add_issue_categories_assigned_to_id.rb
@@ -1,4 +1,4 @@
-class AddIssueCategoriesAssignedToId < ActiveRecord::Migration
+class AddIssueCategoriesAssignedToId < ActiveRecord::Migration[4.2]
def self.up
add_column :issue_categories, :assigned_to_id, :integer
end
diff --git a/db/migrate/059_add_roles_assignable.rb b/db/migrate/059_add_roles_assignable.rb
index a1ba79634..6b4b3f9ca 100644
--- a/db/migrate/059_add_roles_assignable.rb
+++ b/db/migrate/059_add_roles_assignable.rb
@@ -1,4 +1,4 @@
-class AddRolesAssignable < ActiveRecord::Migration
+class AddRolesAssignable < ActiveRecord::Migration[4.2]
def self.up
add_column :roles, :assignable, :boolean, :default => true
end
diff --git a/db/migrate/060_change_changesets_committer_limit.rb b/db/migrate/060_change_changesets_committer_limit.rb
index b05096379..d8a03b8c8 100644
--- a/db/migrate/060_change_changesets_committer_limit.rb
+++ b/db/migrate/060_change_changesets_committer_limit.rb
@@ -1,4 +1,4 @@
-class ChangeChangesetsCommitterLimit < ActiveRecord::Migration
+class ChangeChangesetsCommitterLimit < ActiveRecord::Migration[4.2]
def self.up
change_column :changesets, :committer, :string, :limit => nil
end
diff --git a/db/migrate/061_add_roles_builtin.rb b/db/migrate/061_add_roles_builtin.rb
index a8d6fe9e6..65124b02d 100644
--- a/db/migrate/061_add_roles_builtin.rb
+++ b/db/migrate/061_add_roles_builtin.rb
@@ -1,4 +1,4 @@
-class AddRolesBuiltin < ActiveRecord::Migration
+class AddRolesBuiltin < ActiveRecord::Migration[4.2]
def self.up
add_column :roles, :builtin, :integer, :default => 0, :null => false
end
diff --git a/db/migrate/062_insert_builtin_roles.rb b/db/migrate/062_insert_builtin_roles.rb
index ae3a706e2..07f902f04 100644
--- a/db/migrate/062_insert_builtin_roles.rb
+++ b/db/migrate/062_insert_builtin_roles.rb
@@ -1,4 +1,4 @@
-class InsertBuiltinRoles < ActiveRecord::Migration
+class InsertBuiltinRoles < ActiveRecord::Migration[4.2]
def self.up
Role.reset_column_information
nonmember = Role.new(:name => 'Non member', :position => 0)
diff --git a/db/migrate/063_add_roles_permissions.rb b/db/migrate/063_add_roles_permissions.rb
index 107a3af0a..a2626f82c 100644
--- a/db/migrate/063_add_roles_permissions.rb
+++ b/db/migrate/063_add_roles_permissions.rb
@@ -1,4 +1,4 @@
-class AddRolesPermissions < ActiveRecord::Migration
+class AddRolesPermissions < ActiveRecord::Migration[4.2]
def self.up
add_column :roles, :permissions, :text
end
diff --git a/db/migrate/064_drop_permissions.rb b/db/migrate/064_drop_permissions.rb
index f4ca470bf..6d39519fe 100644
--- a/db/migrate/064_drop_permissions.rb
+++ b/db/migrate/064_drop_permissions.rb
@@ -1,4 +1,4 @@
-class DropPermissions < ActiveRecord::Migration
+class DropPermissions < ActiveRecord::Migration[4.2]
def self.up
drop_table :permissions
drop_table :permissions_roles
diff --git a/db/migrate/065_add_settings_updated_on.rb b/db/migrate/065_add_settings_updated_on.rb
index 1fa002776..ab0b03a15 100644
--- a/db/migrate/065_add_settings_updated_on.rb
+++ b/db/migrate/065_add_settings_updated_on.rb
@@ -1,4 +1,4 @@
-class AddSettingsUpdatedOn < ActiveRecord::Migration
+class AddSettingsUpdatedOn < ActiveRecord::Migration[4.2]
def self.up
add_column :settings, :updated_on, :timestamp
# set updated_on
diff --git a/db/migrate/066_add_custom_value_customized_index.rb b/db/migrate/066_add_custom_value_customized_index.rb
index 1f4c40da2..da4c72570 100644
--- a/db/migrate/066_add_custom_value_customized_index.rb
+++ b/db/migrate/066_add_custom_value_customized_index.rb
@@ -1,4 +1,4 @@
-class AddCustomValueCustomizedIndex < ActiveRecord::Migration
+class AddCustomValueCustomizedIndex < ActiveRecord::Migration[4.2]
def self.up
add_index :custom_values, [:customized_type, :customized_id], :name => :custom_values_customized
end
diff --git a/db/migrate/067_create_wiki_redirects.rb b/db/migrate/067_create_wiki_redirects.rb
index dda6ba6d5..54b1d5dbd 100644
--- a/db/migrate/067_create_wiki_redirects.rb
+++ b/db/migrate/067_create_wiki_redirects.rb
@@ -1,4 +1,4 @@
-class CreateWikiRedirects < ActiveRecord::Migration
+class CreateWikiRedirects < ActiveRecord::Migration[4.2]
def self.up
create_table :wiki_redirects do |t|
t.column :wiki_id, :integer, :null => false
diff --git a/db/migrate/068_create_enabled_modules.rb b/db/migrate/068_create_enabled_modules.rb
index 88005cdb6..c836be76b 100644
--- a/db/migrate/068_create_enabled_modules.rb
+++ b/db/migrate/068_create_enabled_modules.rb
@@ -1,4 +1,4 @@
-class CreateEnabledModules < ActiveRecord::Migration
+class CreateEnabledModules < ActiveRecord::Migration[4.2]
def self.up
create_table :enabled_modules do |t|
t.column :project_id, :integer
diff --git a/db/migrate/069_add_issues_estimated_hours.rb b/db/migrate/069_add_issues_estimated_hours.rb
index 90b86e243..d651993e3 100644
--- a/db/migrate/069_add_issues_estimated_hours.rb
+++ b/db/migrate/069_add_issues_estimated_hours.rb
@@ -1,4 +1,4 @@
-class AddIssuesEstimatedHours < ActiveRecord::Migration
+class AddIssuesEstimatedHours < ActiveRecord::Migration[4.2]
def self.up
add_column :issues, :estimated_hours, :float
end
diff --git a/db/migrate/070_change_attachments_content_type_limit.rb b/db/migrate/070_change_attachments_content_type_limit.rb
index ebf6d08c3..ae9f7363a 100644
--- a/db/migrate/070_change_attachments_content_type_limit.rb
+++ b/db/migrate/070_change_attachments_content_type_limit.rb
@@ -1,4 +1,4 @@
-class ChangeAttachmentsContentTypeLimit < ActiveRecord::Migration
+class ChangeAttachmentsContentTypeLimit < ActiveRecord::Migration[4.2]
def self.up
change_column :attachments, :content_type, :string, :limit => nil
end
diff --git a/db/migrate/071_add_queries_column_names.rb b/db/migrate/071_add_queries_column_names.rb
index acaf4dab0..5f6873afb 100644
--- a/db/migrate/071_add_queries_column_names.rb
+++ b/db/migrate/071_add_queries_column_names.rb
@@ -1,4 +1,4 @@
-class AddQueriesColumnNames < ActiveRecord::Migration
+class AddQueriesColumnNames < ActiveRecord::Migration[4.2]
def self.up
add_column :queries, :column_names, :text
end
diff --git a/db/migrate/072_add_enumerations_position.rb b/db/migrate/072_add_enumerations_position.rb
index 2834abef1..804ce0096 100644
--- a/db/migrate/072_add_enumerations_position.rb
+++ b/db/migrate/072_add_enumerations_position.rb
@@ -1,4 +1,4 @@
-class AddEnumerationsPosition < ActiveRecord::Migration
+class AddEnumerationsPosition < ActiveRecord::Migration[4.2]
def self.up
add_column(:enumerations, :position, :integer, :default => 1) unless Enumeration.column_names.include?('position')
Enumeration.all.group_by(&:opt).each do |opt, enums|
diff --git a/db/migrate/073_add_enumerations_is_default.rb b/db/migrate/073_add_enumerations_is_default.rb
index 7365a1411..269cbf35a 100644
--- a/db/migrate/073_add_enumerations_is_default.rb
+++ b/db/migrate/073_add_enumerations_is_default.rb
@@ -1,4 +1,4 @@
-class AddEnumerationsIsDefault < ActiveRecord::Migration
+class AddEnumerationsIsDefault < ActiveRecord::Migration[4.2]
def self.up
add_column :enumerations, :is_default, :boolean, :default => false, :null => false
end
diff --git a/db/migrate/074_add_auth_sources_tls.rb b/db/migrate/074_add_auth_sources_tls.rb
index 3987f7036..298e39e6e 100644
--- a/db/migrate/074_add_auth_sources_tls.rb
+++ b/db/migrate/074_add_auth_sources_tls.rb
@@ -1,4 +1,4 @@
-class AddAuthSourcesTls < ActiveRecord::Migration
+class AddAuthSourcesTls < ActiveRecord::Migration[4.2]
def self.up
add_column :auth_sources, :tls, :boolean, :default => false, :null => false
end
diff --git a/db/migrate/075_add_members_mail_notification.rb b/db/migrate/075_add_members_mail_notification.rb
index d83ba8dd0..8722e95fd 100644
--- a/db/migrate/075_add_members_mail_notification.rb
+++ b/db/migrate/075_add_members_mail_notification.rb
@@ -1,4 +1,4 @@
-class AddMembersMailNotification < ActiveRecord::Migration
+class AddMembersMailNotification < ActiveRecord::Migration[4.2]
def self.up
add_column :members, :mail_notification, :boolean, :default => false, :null => false
end
diff --git a/db/migrate/076_allow_null_position.rb b/db/migrate/076_allow_null_position.rb
index afb93810a..a5f396fcd 100644
--- a/db/migrate/076_allow_null_position.rb
+++ b/db/migrate/076_allow_null_position.rb
@@ -1,4 +1,4 @@
-class AllowNullPosition < ActiveRecord::Migration
+class AllowNullPosition < ActiveRecord::Migration[4.2]
def self.up
Enumeration.reset_column_information
diff --git a/db/migrate/077_remove_issue_statuses_html_color.rb b/db/migrate/077_remove_issue_statuses_html_color.rb
index a3e2c3f8f..fdf64ce29 100644
--- a/db/migrate/077_remove_issue_statuses_html_color.rb
+++ b/db/migrate/077_remove_issue_statuses_html_color.rb
@@ -1,4 +1,4 @@
-class RemoveIssueStatusesHtmlColor < ActiveRecord::Migration
+class RemoveIssueStatusesHtmlColor < ActiveRecord::Migration[4.2]
def self.up
remove_column :issue_statuses, :html_color
end
diff --git a/db/migrate/078_add_custom_fields_position.rb b/db/migrate/078_add_custom_fields_position.rb
index a03db4618..ebe84416b 100644
--- a/db/migrate/078_add_custom_fields_position.rb
+++ b/db/migrate/078_add_custom_fields_position.rb
@@ -1,4 +1,4 @@
-class AddCustomFieldsPosition < ActiveRecord::Migration
+class AddCustomFieldsPosition < ActiveRecord::Migration[4.2]
def self.up
add_column(:custom_fields, :position, :integer, :default => 1)
CustomField.all.group_by(&:type).each do |t, fields|
diff --git a/db/migrate/079_add_user_preferences_time_zone.rb b/db/migrate/079_add_user_preferences_time_zone.rb
index 9e36790a9..fd3ac2c6f 100644
--- a/db/migrate/079_add_user_preferences_time_zone.rb
+++ b/db/migrate/079_add_user_preferences_time_zone.rb
@@ -1,4 +1,4 @@
-class AddUserPreferencesTimeZone < ActiveRecord::Migration
+class AddUserPreferencesTimeZone < ActiveRecord::Migration[4.2]
def self.up
add_column :user_preferences, :time_zone, :string
end
diff --git a/db/migrate/080_add_users_type.rb b/db/migrate/080_add_users_type.rb
index c907b472e..342a99583 100644
--- a/db/migrate/080_add_users_type.rb
+++ b/db/migrate/080_add_users_type.rb
@@ -1,4 +1,4 @@
-class AddUsersType < ActiveRecord::Migration
+class AddUsersType < ActiveRecord::Migration[4.2]
def self.up
add_column :users, :type, :string
User.update_all "type = 'User'"
diff --git a/db/migrate/081_create_projects_trackers.rb b/db/migrate/081_create_projects_trackers.rb
index ddb801d31..8156e39a8 100644
--- a/db/migrate/081_create_projects_trackers.rb
+++ b/db/migrate/081_create_projects_trackers.rb
@@ -1,4 +1,4 @@
-class CreateProjectsTrackers < ActiveRecord::Migration
+class CreateProjectsTrackers < ActiveRecord::Migration[4.2]
def self.up
create_table :projects_trackers, :id => false do |t|
t.column :project_id, :integer, :default => 0, :null => false
diff --git a/db/migrate/082_add_messages_locked.rb b/db/migrate/082_add_messages_locked.rb
index 20a172565..c88533e9f 100644
--- a/db/migrate/082_add_messages_locked.rb
+++ b/db/migrate/082_add_messages_locked.rb
@@ -1,4 +1,4 @@
-class AddMessagesLocked < ActiveRecord::Migration
+class AddMessagesLocked < ActiveRecord::Migration[4.2]
def self.up
add_column :messages, :locked, :boolean, :default => false
end
diff --git a/db/migrate/083_add_messages_sticky.rb b/db/migrate/083_add_messages_sticky.rb
index 8fd5d2ce3..aa6dde285 100644
--- a/db/migrate/083_add_messages_sticky.rb
+++ b/db/migrate/083_add_messages_sticky.rb
@@ -1,4 +1,4 @@
-class AddMessagesSticky < ActiveRecord::Migration
+class AddMessagesSticky < ActiveRecord::Migration[4.2]
def self.up
add_column :messages, :sticky, :integer, :default => 0
end
diff --git a/db/migrate/084_change_auth_sources_account_limit.rb b/db/migrate/084_change_auth_sources_account_limit.rb
index cc127b439..4e2870aa0 100644
--- a/db/migrate/084_change_auth_sources_account_limit.rb
+++ b/db/migrate/084_change_auth_sources_account_limit.rb
@@ -1,4 +1,4 @@
-class ChangeAuthSourcesAccountLimit < ActiveRecord::Migration
+class ChangeAuthSourcesAccountLimit < ActiveRecord::Migration[4.2]
def self.up
change_column :auth_sources, :account, :string, :limit => nil
end
diff --git a/db/migrate/085_add_role_tracker_old_status_index_to_workflows.rb b/db/migrate/085_add_role_tracker_old_status_index_to_workflows.rb
index a59135be0..12c150440 100644
--- a/db/migrate/085_add_role_tracker_old_status_index_to_workflows.rb
+++ b/db/migrate/085_add_role_tracker_old_status_index_to_workflows.rb
@@ -1,4 +1,4 @@
-class AddRoleTrackerOldStatusIndexToWorkflows < ActiveRecord::Migration
+class AddRoleTrackerOldStatusIndexToWorkflows < ActiveRecord::Migration[4.2]
def self.up
add_index :workflows, [:role_id, :tracker_id, :old_status_id], :name => :wkfs_role_tracker_old_status
end
diff --git a/db/migrate/086_add_custom_fields_searchable.rb b/db/migrate/086_add_custom_fields_searchable.rb
index 53158d14e..5ee187577 100644
--- a/db/migrate/086_add_custom_fields_searchable.rb
+++ b/db/migrate/086_add_custom_fields_searchable.rb
@@ -1,4 +1,4 @@
-class AddCustomFieldsSearchable < ActiveRecord::Migration
+class AddCustomFieldsSearchable < ActiveRecord::Migration[4.2]
def self.up
add_column :custom_fields, :searchable, :boolean, :default => false
end
diff --git a/db/migrate/087_change_projects_description_to_text.rb b/db/migrate/087_change_projects_description_to_text.rb
index 132e921b3..0f1d8fe92 100644
--- a/db/migrate/087_change_projects_description_to_text.rb
+++ b/db/migrate/087_change_projects_description_to_text.rb
@@ -1,4 +1,4 @@
-class ChangeProjectsDescriptionToText < ActiveRecord::Migration
+class ChangeProjectsDescriptionToText < ActiveRecord::Migration[4.2]
def self.up
change_column :projects, :description, :text, :null => true, :default => nil
end
diff --git a/db/migrate/088_add_custom_fields_default_value.rb b/db/migrate/088_add_custom_fields_default_value.rb
index 33a39ec6e..1148c0726 100644
--- a/db/migrate/088_add_custom_fields_default_value.rb
+++ b/db/migrate/088_add_custom_fields_default_value.rb
@@ -1,4 +1,4 @@
-class AddCustomFieldsDefaultValue < ActiveRecord::Migration
+class AddCustomFieldsDefaultValue < ActiveRecord::Migration[4.2]
def self.up
add_column :custom_fields, :default_value, :text
end
diff --git a/db/migrate/089_add_attachments_description.rb b/db/migrate/089_add_attachments_description.rb
index 411dfe4d6..f2a9666b6 100644
--- a/db/migrate/089_add_attachments_description.rb
+++ b/db/migrate/089_add_attachments_description.rb
@@ -1,4 +1,4 @@
-class AddAttachmentsDescription < ActiveRecord::Migration
+class AddAttachmentsDescription < ActiveRecord::Migration[4.2]
def self.up
add_column :attachments, :description, :string
end
diff --git a/db/migrate/090_change_versions_name_limit.rb b/db/migrate/090_change_versions_name_limit.rb
index 276429727..5f34cd501 100644
--- a/db/migrate/090_change_versions_name_limit.rb
+++ b/db/migrate/090_change_versions_name_limit.rb
@@ -1,4 +1,4 @@
-class ChangeVersionsNameLimit < ActiveRecord::Migration
+class ChangeVersionsNameLimit < ActiveRecord::Migration[4.2]
def self.up
change_column :versions, :name, :string, :limit => nil
end
diff --git a/db/migrate/091_change_changesets_revision_to_string.rb b/db/migrate/091_change_changesets_revision_to_string.rb
index 64988069d..f92f8f79e 100644
--- a/db/migrate/091_change_changesets_revision_to_string.rb
+++ b/db/migrate/091_change_changesets_revision_to_string.rb
@@ -1,4 +1,4 @@
-class ChangeChangesetsRevisionToString < ActiveRecord::Migration
+class ChangeChangesetsRevisionToString < ActiveRecord::Migration[4.2]
def self.up
# Some backends (eg. SQLServer 2012) do not support changing the type
# of an indexed column so the index needs to be dropped first
diff --git a/db/migrate/092_change_changes_from_revision_to_string.rb b/db/migrate/092_change_changes_from_revision_to_string.rb
index b298a3f45..c91919cc0 100644
--- a/db/migrate/092_change_changes_from_revision_to_string.rb
+++ b/db/migrate/092_change_changes_from_revision_to_string.rb
@@ -1,4 +1,4 @@
-class ChangeChangesFromRevisionToString < ActiveRecord::Migration
+class ChangeChangesFromRevisionToString < ActiveRecord::Migration[4.2]
def self.up
change_column :changes, :from_revision, :string
end
diff --git a/db/migrate/093_add_wiki_pages_protected.rb b/db/migrate/093_add_wiki_pages_protected.rb
index 49720fbb7..6ff72d8c5 100644
--- a/db/migrate/093_add_wiki_pages_protected.rb
+++ b/db/migrate/093_add_wiki_pages_protected.rb
@@ -1,4 +1,4 @@
-class AddWikiPagesProtected < ActiveRecord::Migration
+class AddWikiPagesProtected < ActiveRecord::Migration[4.2]
def self.up
add_column :wiki_pages, :protected, :boolean, :default => false, :null => false
end
diff --git a/db/migrate/094_change_projects_homepage_limit.rb b/db/migrate/094_change_projects_homepage_limit.rb
index 98374aa4e..950c53ede 100644
--- a/db/migrate/094_change_projects_homepage_limit.rb
+++ b/db/migrate/094_change_projects_homepage_limit.rb
@@ -1,4 +1,4 @@
-class ChangeProjectsHomepageLimit < ActiveRecord::Migration
+class ChangeProjectsHomepageLimit < ActiveRecord::Migration[4.2]
def self.up
change_column :projects, :homepage, :string, :limit => nil, :default => ''
end
diff --git a/db/migrate/095_add_wiki_pages_parent_id.rb b/db/migrate/095_add_wiki_pages_parent_id.rb
index 36b922ec1..6aff1fb4e 100644
--- a/db/migrate/095_add_wiki_pages_parent_id.rb
+++ b/db/migrate/095_add_wiki_pages_parent_id.rb
@@ -1,4 +1,4 @@
-class AddWikiPagesParentId < ActiveRecord::Migration
+class AddWikiPagesParentId < ActiveRecord::Migration[4.2]
def self.up
add_column :wiki_pages, :parent_id, :integer, :default => nil
end
diff --git a/db/migrate/096_add_commit_access_permission.rb b/db/migrate/096_add_commit_access_permission.rb
index 39642cdfe..9b5fc66e6 100644
--- a/db/migrate/096_add_commit_access_permission.rb
+++ b/db/migrate/096_add_commit_access_permission.rb
@@ -1,4 +1,4 @@
-class AddCommitAccessPermission < ActiveRecord::Migration
+class AddCommitAccessPermission < ActiveRecord::Migration[4.2]
def self.up
Role.all.select { |r| not r.builtin? }.each do |r|
r.add_permission!(:commit_access)
diff --git a/db/migrate/097_add_view_wiki_edits_permission.rb b/db/migrate/097_add_view_wiki_edits_permission.rb
index cd25f3cb1..1808f72ef 100644
--- a/db/migrate/097_add_view_wiki_edits_permission.rb
+++ b/db/migrate/097_add_view_wiki_edits_permission.rb
@@ -1,4 +1,4 @@
-class AddViewWikiEditsPermission < ActiveRecord::Migration
+class AddViewWikiEditsPermission < ActiveRecord::Migration[4.2]
def self.up
Role.all.each do |r|
r.add_permission!(:view_wiki_edits) if r.has_permission?(:view_wiki_pages)
diff --git a/db/migrate/098_set_topic_authors_as_watchers.rb b/db/migrate/098_set_topic_authors_as_watchers.rb
index 1a1529561..979ae8edc 100644
--- a/db/migrate/098_set_topic_authors_as_watchers.rb
+++ b/db/migrate/098_set_topic_authors_as_watchers.rb
@@ -1,4 +1,4 @@
-class SetTopicAuthorsAsWatchers < ActiveRecord::Migration
+class SetTopicAuthorsAsWatchers < ActiveRecord::Migration[4.2]
def self.up
# Sets active users who created/replied a topic as watchers of the topic
# so that the new watch functionality at topic level doesn't affect notifications behaviour
diff --git a/db/migrate/099_add_delete_wiki_pages_attachments_permission.rb b/db/migrate/099_add_delete_wiki_pages_attachments_permission.rb
index 475e4d0aa..b016bfcb6 100644
--- a/db/migrate/099_add_delete_wiki_pages_attachments_permission.rb
+++ b/db/migrate/099_add_delete_wiki_pages_attachments_permission.rb
@@ -1,4 +1,4 @@
-class AddDeleteWikiPagesAttachmentsPermission < ActiveRecord::Migration
+class AddDeleteWikiPagesAttachmentsPermission < ActiveRecord::Migration[4.2]
def self.up
Role.all.each do |r|
r.add_permission!(:delete_wiki_pages_attachments) if r.has_permission?(:edit_wiki_pages)
diff --git a/db/migrate/100_add_changesets_user_id.rb b/db/migrate/100_add_changesets_user_id.rb
index 9b25fd7bc..8b722aec6 100644
--- a/db/migrate/100_add_changesets_user_id.rb
+++ b/db/migrate/100_add_changesets_user_id.rb
@@ -1,4 +1,4 @@
-class AddChangesetsUserId < ActiveRecord::Migration
+class AddChangesetsUserId < ActiveRecord::Migration[4.2]
def self.up
add_column :changesets, :user_id, :integer, :default => nil
end
diff --git a/db/migrate/101_populate_changesets_user_id.rb b/db/migrate/101_populate_changesets_user_id.rb
index 566363f7c..7e7d81d4f 100644
--- a/db/migrate/101_populate_changesets_user_id.rb
+++ b/db/migrate/101_populate_changesets_user_id.rb
@@ -1,4 +1,4 @@
-class PopulateChangesetsUserId < ActiveRecord::Migration
+class PopulateChangesetsUserId < ActiveRecord::Migration[4.2]
def self.up
committers = Changeset.connection.select_values("SELECT DISTINCT committer FROM #{Changeset.table_name}")
committers.each do |committer|
diff --git a/db/migrate/102_add_custom_fields_editable.rb b/db/migrate/102_add_custom_fields_editable.rb
index 949f9db9d..28b73cc71 100644
--- a/db/migrate/102_add_custom_fields_editable.rb
+++ b/db/migrate/102_add_custom_fields_editable.rb
@@ -1,4 +1,4 @@
-class AddCustomFieldsEditable < ActiveRecord::Migration
+class AddCustomFieldsEditable < ActiveRecord::Migration[4.2]
def self.up
add_column :custom_fields, :editable, :boolean, :default => true
end
diff --git a/db/migrate/103_set_custom_fields_editable.rb b/db/migrate/103_set_custom_fields_editable.rb
index 937649e61..c43846c3a 100644
--- a/db/migrate/103_set_custom_fields_editable.rb
+++ b/db/migrate/103_set_custom_fields_editable.rb
@@ -1,4 +1,4 @@
-class SetCustomFieldsEditable < ActiveRecord::Migration
+class SetCustomFieldsEditable < ActiveRecord::Migration[4.2]
def self.up
UserCustomField.update_all("editable = #{CustomField.connection.quoted_false}")
end
diff --git a/db/migrate/104_add_projects_lft_and_rgt.rb b/db/migrate/104_add_projects_lft_and_rgt.rb
index 8952c16e1..77569fc45 100644
--- a/db/migrate/104_add_projects_lft_and_rgt.rb
+++ b/db/migrate/104_add_projects_lft_and_rgt.rb
@@ -1,4 +1,4 @@
-class AddProjectsLftAndRgt < ActiveRecord::Migration
+class AddProjectsLftAndRgt < ActiveRecord::Migration[4.2]
def self.up
add_column :projects, :lft, :integer
add_column :projects, :rgt, :integer
diff --git a/db/migrate/105_build_projects_tree.rb b/db/migrate/105_build_projects_tree.rb
index cd35373c0..27ca3dfba 100644
--- a/db/migrate/105_build_projects_tree.rb
+++ b/db/migrate/105_build_projects_tree.rb
@@ -1,4 +1,4 @@
-class BuildProjectsTree < ActiveRecord::Migration
+class BuildProjectsTree < ActiveRecord::Migration[4.2]
def self.up
Project.rebuild_tree!
end
diff --git a/db/migrate/106_remove_projects_projects_count.rb b/db/migrate/106_remove_projects_projects_count.rb
index 68bb3d115..4f14974da 100644
--- a/db/migrate/106_remove_projects_projects_count.rb
+++ b/db/migrate/106_remove_projects_projects_count.rb
@@ -1,4 +1,4 @@
-class RemoveProjectsProjectsCount < ActiveRecord::Migration
+class RemoveProjectsProjectsCount < ActiveRecord::Migration[4.2]
def self.up
remove_column :projects, :projects_count
end
diff --git a/db/migrate/107_add_open_id_authentication_tables.rb b/db/migrate/107_add_open_id_authentication_tables.rb
index caae0d8c7..3d6d6e9b5 100644
--- a/db/migrate/107_add_open_id_authentication_tables.rb
+++ b/db/migrate/107_add_open_id_authentication_tables.rb
@@ -1,4 +1,4 @@
-class AddOpenIdAuthenticationTables < ActiveRecord::Migration
+class AddOpenIdAuthenticationTables < ActiveRecord::Migration[4.2]
def self.up
create_table :open_id_authentication_associations, :force => true do |t|
t.integer :issued, :lifetime
diff --git a/db/migrate/108_add_identity_url_to_users.rb b/db/migrate/108_add_identity_url_to_users.rb
index f5af77b24..009743c0b 100644
--- a/db/migrate/108_add_identity_url_to_users.rb
+++ b/db/migrate/108_add_identity_url_to_users.rb
@@ -1,4 +1,4 @@
-class AddIdentityUrlToUsers < ActiveRecord::Migration
+class AddIdentityUrlToUsers < ActiveRecord::Migration[4.2]
def self.up
add_column :users, :identity_url, :string
end
diff --git a/db/migrate/20090214190337_add_watchers_user_id_type_index.rb b/db/migrate/20090214190337_add_watchers_user_id_type_index.rb
index 7ff4e542c..c60a3b2ee 100644
--- a/db/migrate/20090214190337_add_watchers_user_id_type_index.rb
+++ b/db/migrate/20090214190337_add_watchers_user_id_type_index.rb
@@ -1,4 +1,4 @@
-class AddWatchersUserIdTypeIndex < ActiveRecord::Migration
+class AddWatchersUserIdTypeIndex < ActiveRecord::Migration[4.2]
def self.up
add_index :watchers, [:user_id, :watchable_type], :name => :watchers_user_id_type
end
diff --git a/db/migrate/20090312172426_add_queries_sort_criteria.rb b/db/migrate/20090312172426_add_queries_sort_criteria.rb
index 743ed42ff..c5bc030fb 100644
--- a/db/migrate/20090312172426_add_queries_sort_criteria.rb
+++ b/db/migrate/20090312172426_add_queries_sort_criteria.rb
@@ -1,4 +1,4 @@
-class AddQueriesSortCriteria < ActiveRecord::Migration
+class AddQueriesSortCriteria < ActiveRecord::Migration[4.2]
def self.up
add_column :queries, :sort_criteria, :text
end
diff --git a/db/migrate/20090312194159_add_projects_trackers_unique_index.rb b/db/migrate/20090312194159_add_projects_trackers_unique_index.rb
index f4e3a26d2..24fb6c293 100644
--- a/db/migrate/20090312194159_add_projects_trackers_unique_index.rb
+++ b/db/migrate/20090312194159_add_projects_trackers_unique_index.rb
@@ -1,4 +1,4 @@
-class AddProjectsTrackersUniqueIndex < ActiveRecord::Migration
+class AddProjectsTrackersUniqueIndex < ActiveRecord::Migration[4.2]
def self.up
remove_duplicates
add_index :projects_trackers, [:project_id, :tracker_id], :name => :projects_trackers_unique, :unique => true
diff --git a/db/migrate/20090318181151_extend_settings_name.rb b/db/migrate/20090318181151_extend_settings_name.rb
index eca03d555..1091dac7e 100644
--- a/db/migrate/20090318181151_extend_settings_name.rb
+++ b/db/migrate/20090318181151_extend_settings_name.rb
@@ -1,4 +1,4 @@
-class ExtendSettingsName < ActiveRecord::Migration
+class ExtendSettingsName < ActiveRecord::Migration[4.2]
def self.up
change_column :settings, :name, :string, :limit => 255, :default => '', :null => false
end
diff --git a/db/migrate/20090323224724_add_type_to_enumerations.rb b/db/migrate/20090323224724_add_type_to_enumerations.rb
index c2aef5e4a..100468d4b 100644
--- a/db/migrate/20090323224724_add_type_to_enumerations.rb
+++ b/db/migrate/20090323224724_add_type_to_enumerations.rb
@@ -1,4 +1,4 @@
-class AddTypeToEnumerations < ActiveRecord::Migration
+class AddTypeToEnumerations < ActiveRecord::Migration[4.2]
def self.up
add_column :enumerations, :type, :string
end
diff --git a/db/migrate/20090401221305_update_enumerations_to_sti.rb b/db/migrate/20090401221305_update_enumerations_to_sti.rb
index 031dd4656..1ba41076e 100644
--- a/db/migrate/20090401221305_update_enumerations_to_sti.rb
+++ b/db/migrate/20090401221305_update_enumerations_to_sti.rb
@@ -1,4 +1,4 @@
-class UpdateEnumerationsToSti < ActiveRecord::Migration
+class UpdateEnumerationsToSti < ActiveRecord::Migration[4.2]
def self.up
Enumeration.where("opt = 'IPRI'").update_all("type = 'IssuePriority'")
Enumeration.where("opt = 'DCAT'").update_all("type = 'DocumentCategory'")
diff --git a/db/migrate/20090401231134_add_active_field_to_enumerations.rb b/db/migrate/20090401231134_add_active_field_to_enumerations.rb
index 55824fa65..5b9e432b5 100644
--- a/db/migrate/20090401231134_add_active_field_to_enumerations.rb
+++ b/db/migrate/20090401231134_add_active_field_to_enumerations.rb
@@ -1,4 +1,4 @@
-class AddActiveFieldToEnumerations < ActiveRecord::Migration
+class AddActiveFieldToEnumerations < ActiveRecord::Migration[4.2]
def self.up
add_column :enumerations, :active, :boolean, :default => true, :null => false
end
diff --git a/db/migrate/20090403001910_add_project_to_enumerations.rb b/db/migrate/20090403001910_add_project_to_enumerations.rb
index a3db6d51e..a90928949 100644
--- a/db/migrate/20090403001910_add_project_to_enumerations.rb
+++ b/db/migrate/20090403001910_add_project_to_enumerations.rb
@@ -1,4 +1,4 @@
-class AddProjectToEnumerations < ActiveRecord::Migration
+class AddProjectToEnumerations < ActiveRecord::Migration[4.2]
def self.up
add_column :enumerations, :project_id, :integer, :null => true, :default => nil
add_index :enumerations, :project_id
diff --git a/db/migrate/20090406161854_add_parent_id_to_enumerations.rb b/db/migrate/20090406161854_add_parent_id_to_enumerations.rb
index 2c1b1780d..546c0b704 100644
--- a/db/migrate/20090406161854_add_parent_id_to_enumerations.rb
+++ b/db/migrate/20090406161854_add_parent_id_to_enumerations.rb
@@ -1,4 +1,4 @@
-class AddParentIdToEnumerations < ActiveRecord::Migration
+class AddParentIdToEnumerations < ActiveRecord::Migration[4.2]
def self.up
add_column :enumerations, :parent_id, :integer, :null => true, :default => nil
end
diff --git a/db/migrate/20090425161243_add_queries_group_by.rb b/db/migrate/20090425161243_add_queries_group_by.rb
index 1405f3d0b..07e1c5938 100644
--- a/db/migrate/20090425161243_add_queries_group_by.rb
+++ b/db/migrate/20090425161243_add_queries_group_by.rb
@@ -1,4 +1,4 @@
-class AddQueriesGroupBy < ActiveRecord::Migration
+class AddQueriesGroupBy < ActiveRecord::Migration[4.2]
def self.up
add_column :queries, :group_by, :string
end
diff --git a/db/migrate/20090503121501_create_member_roles.rb b/db/migrate/20090503121501_create_member_roles.rb
index 38519ea7c..69ce2e81f 100644
--- a/db/migrate/20090503121501_create_member_roles.rb
+++ b/db/migrate/20090503121501_create_member_roles.rb
@@ -1,4 +1,4 @@
-class CreateMemberRoles < ActiveRecord::Migration
+class CreateMemberRoles < ActiveRecord::Migration[4.2]
def self.up
create_table :member_roles do |t|
t.column :member_id, :integer, :null => false
diff --git a/db/migrate/20090503121505_populate_member_roles.rb b/db/migrate/20090503121505_populate_member_roles.rb
index 285d7e51a..e5f246afa 100644
--- a/db/migrate/20090503121505_populate_member_roles.rb
+++ b/db/migrate/20090503121505_populate_member_roles.rb
@@ -1,4 +1,4 @@
-class PopulateMemberRoles < ActiveRecord::Migration
+class PopulateMemberRoles < ActiveRecord::Migration[4.2]
def self.up
MemberRole.delete_all
Member.all.each do |member|
diff --git a/db/migrate/20090503121510_drop_members_role_id.rb b/db/migrate/20090503121510_drop_members_role_id.rb
index c28119910..7b8e3cf9a 100644
--- a/db/migrate/20090503121510_drop_members_role_id.rb
+++ b/db/migrate/20090503121510_drop_members_role_id.rb
@@ -1,4 +1,4 @@
-class DropMembersRoleId < ActiveRecord::Migration
+class DropMembersRoleId < ActiveRecord::Migration[4.2]
def self.up
remove_column :members, :role_id
end
diff --git a/db/migrate/20090614091200_fix_messages_sticky_null.rb b/db/migrate/20090614091200_fix_messages_sticky_null.rb
index fcb8b4504..66ea4bf2c 100644
--- a/db/migrate/20090614091200_fix_messages_sticky_null.rb
+++ b/db/migrate/20090614091200_fix_messages_sticky_null.rb
@@ -1,4 +1,4 @@
-class FixMessagesStickyNull < ActiveRecord::Migration
+class FixMessagesStickyNull < ActiveRecord::Migration[4.2]
def self.up
Message.where('sticky IS NULL').update_all('sticky = 0')
end
diff --git a/db/migrate/20090704172350_populate_users_type.rb b/db/migrate/20090704172350_populate_users_type.rb
index e7c72d532..8342f9774 100644
--- a/db/migrate/20090704172350_populate_users_type.rb
+++ b/db/migrate/20090704172350_populate_users_type.rb
@@ -1,4 +1,4 @@
-class PopulateUsersType < ActiveRecord::Migration
+class PopulateUsersType < ActiveRecord::Migration[4.2]
def self.up
Principal.where("type IS NULL").update_all("type = 'User'")
end
diff --git a/db/migrate/20090704172355_create_groups_users.rb b/db/migrate/20090704172355_create_groups_users.rb
index 9ce03b95b..6d676304f 100644
--- a/db/migrate/20090704172355_create_groups_users.rb
+++ b/db/migrate/20090704172355_create_groups_users.rb
@@ -1,4 +1,4 @@
-class CreateGroupsUsers < ActiveRecord::Migration
+class CreateGroupsUsers < ActiveRecord::Migration[4.2]
def self.up
create_table :groups_users, :id => false do |t|
t.column :group_id, :integer, :null => false
diff --git a/db/migrate/20090704172358_add_member_roles_inherited_from.rb b/db/migrate/20090704172358_add_member_roles_inherited_from.rb
index 4ffa52389..45f0e45a4 100644
--- a/db/migrate/20090704172358_add_member_roles_inherited_from.rb
+++ b/db/migrate/20090704172358_add_member_roles_inherited_from.rb
@@ -1,4 +1,4 @@
-class AddMemberRolesInheritedFrom < ActiveRecord::Migration
+class AddMemberRolesInheritedFrom < ActiveRecord::Migration[4.2]
def self.up
add_column :member_roles, :inherited_from, :integer
end
diff --git a/db/migrate/20091010093521_fix_users_custom_values.rb b/db/migrate/20091010093521_fix_users_custom_values.rb
index 93c5cfba2..38cabac86 100644
--- a/db/migrate/20091010093521_fix_users_custom_values.rb
+++ b/db/migrate/20091010093521_fix_users_custom_values.rb
@@ -1,4 +1,4 @@
-class FixUsersCustomValues < ActiveRecord::Migration
+class FixUsersCustomValues < ActiveRecord::Migration[4.2]
def self.up
CustomValue.where("customized_type = 'User'").
update_all("customized_type = 'Principal'")
diff --git a/db/migrate/20091017212227_add_missing_indexes_to_workflows.rb b/db/migrate/20091017212227_add_missing_indexes_to_workflows.rb
index 13fa0137e..bf84c4f03 100644
--- a/db/migrate/20091017212227_add_missing_indexes_to_workflows.rb
+++ b/db/migrate/20091017212227_add_missing_indexes_to_workflows.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToWorkflows < ActiveRecord::Migration
+class AddMissingIndexesToWorkflows < ActiveRecord::Migration[4.2]
def self.up
add_index :workflows, :old_status_id
add_index :workflows, :role_id
diff --git a/db/migrate/20091017212457_add_missing_indexes_to_custom_fields_projects.rb b/db/migrate/20091017212457_add_missing_indexes_to_custom_fields_projects.rb
index b95f54327..235f1e6ed 100644
--- a/db/migrate/20091017212457_add_missing_indexes_to_custom_fields_projects.rb
+++ b/db/migrate/20091017212457_add_missing_indexes_to_custom_fields_projects.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToCustomFieldsProjects < ActiveRecord::Migration
+class AddMissingIndexesToCustomFieldsProjects < ActiveRecord::Migration[4.2]
def self.up
add_index :custom_fields_projects, [:custom_field_id, :project_id]
end
diff --git a/db/migrate/20091017212644_add_missing_indexes_to_messages.rb b/db/migrate/20091017212644_add_missing_indexes_to_messages.rb
index 23c272995..06897e1c0 100644
--- a/db/migrate/20091017212644_add_missing_indexes_to_messages.rb
+++ b/db/migrate/20091017212644_add_missing_indexes_to_messages.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToMessages < ActiveRecord::Migration
+class AddMissingIndexesToMessages < ActiveRecord::Migration[4.2]
def self.up
add_index :messages, :last_reply_id
add_index :messages, :author_id
diff --git a/db/migrate/20091017212938_add_missing_indexes_to_repositories.rb b/db/migrate/20091017212938_add_missing_indexes_to_repositories.rb
index b9f43b6df..c9ac3f120 100644
--- a/db/migrate/20091017212938_add_missing_indexes_to_repositories.rb
+++ b/db/migrate/20091017212938_add_missing_indexes_to_repositories.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToRepositories < ActiveRecord::Migration
+class AddMissingIndexesToRepositories < ActiveRecord::Migration[4.2]
def self.up
add_index :repositories, :project_id
end
diff --git a/db/migrate/20091017213027_add_missing_indexes_to_comments.rb b/db/migrate/20091017213027_add_missing_indexes_to_comments.rb
index 2a1ed27c0..4bb8c0010 100644
--- a/db/migrate/20091017213027_add_missing_indexes_to_comments.rb
+++ b/db/migrate/20091017213027_add_missing_indexes_to_comments.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToComments < ActiveRecord::Migration
+class AddMissingIndexesToComments < ActiveRecord::Migration[4.2]
def self.up
add_index :comments, [:commented_id, :commented_type]
add_index :comments, :author_id
diff --git a/db/migrate/20091017213113_add_missing_indexes_to_enumerations.rb b/db/migrate/20091017213113_add_missing_indexes_to_enumerations.rb
index 85dedf816..e97b993da 100644
--- a/db/migrate/20091017213113_add_missing_indexes_to_enumerations.rb
+++ b/db/migrate/20091017213113_add_missing_indexes_to_enumerations.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToEnumerations < ActiveRecord::Migration
+class AddMissingIndexesToEnumerations < ActiveRecord::Migration[4.2]
def self.up
add_index :enumerations, [:id, :type]
end
diff --git a/db/migrate/20091017213151_add_missing_indexes_to_wiki_pages.rb b/db/migrate/20091017213151_add_missing_indexes_to_wiki_pages.rb
index 7fab09e38..edeca8da7 100644
--- a/db/migrate/20091017213151_add_missing_indexes_to_wiki_pages.rb
+++ b/db/migrate/20091017213151_add_missing_indexes_to_wiki_pages.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToWikiPages < ActiveRecord::Migration
+class AddMissingIndexesToWikiPages < ActiveRecord::Migration[4.2]
def self.up
add_index :wiki_pages, :wiki_id
add_index :wiki_pages, :parent_id
diff --git a/db/migrate/20091017213228_add_missing_indexes_to_watchers.rb b/db/migrate/20091017213228_add_missing_indexes_to_watchers.rb
index 618e1cd94..18e948ec6 100644
--- a/db/migrate/20091017213228_add_missing_indexes_to_watchers.rb
+++ b/db/migrate/20091017213228_add_missing_indexes_to_watchers.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToWatchers < ActiveRecord::Migration
+class AddMissingIndexesToWatchers < ActiveRecord::Migration[4.2]
def self.up
add_index :watchers, :user_id
add_index :watchers, [:watchable_id, :watchable_type]
diff --git a/db/migrate/20091017213257_add_missing_indexes_to_auth_sources.rb b/db/migrate/20091017213257_add_missing_indexes_to_auth_sources.rb
index ccd4f0440..eca45226d 100644
--- a/db/migrate/20091017213257_add_missing_indexes_to_auth_sources.rb
+++ b/db/migrate/20091017213257_add_missing_indexes_to_auth_sources.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToAuthSources < ActiveRecord::Migration
+class AddMissingIndexesToAuthSources < ActiveRecord::Migration[4.2]
def self.up
add_index :auth_sources, [:id, :type]
end
diff --git a/db/migrate/20091017213332_add_missing_indexes_to_documents.rb b/db/migrate/20091017213332_add_missing_indexes_to_documents.rb
index f5190181e..a4e7e95dc 100644
--- a/db/migrate/20091017213332_add_missing_indexes_to_documents.rb
+++ b/db/migrate/20091017213332_add_missing_indexes_to_documents.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToDocuments < ActiveRecord::Migration
+class AddMissingIndexesToDocuments < ActiveRecord::Migration[4.2]
def self.up
add_index :documents, :category_id
end
diff --git a/db/migrate/20091017213444_add_missing_indexes_to_tokens.rb b/db/migrate/20091017213444_add_missing_indexes_to_tokens.rb
index f0979f21c..27ce82a93 100644
--- a/db/migrate/20091017213444_add_missing_indexes_to_tokens.rb
+++ b/db/migrate/20091017213444_add_missing_indexes_to_tokens.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToTokens < ActiveRecord::Migration
+class AddMissingIndexesToTokens < ActiveRecord::Migration[4.2]
def self.up
add_index :tokens, :user_id
end
diff --git a/db/migrate/20091017213536_add_missing_indexes_to_changesets.rb b/db/migrate/20091017213536_add_missing_indexes_to_changesets.rb
index 303be838d..a71910841 100644
--- a/db/migrate/20091017213536_add_missing_indexes_to_changesets.rb
+++ b/db/migrate/20091017213536_add_missing_indexes_to_changesets.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToChangesets < ActiveRecord::Migration
+class AddMissingIndexesToChangesets < ActiveRecord::Migration[4.2]
def self.up
add_index :changesets, :user_id
add_index :changesets, :repository_id
diff --git a/db/migrate/20091017213642_add_missing_indexes_to_issue_categories.rb b/db/migrate/20091017213642_add_missing_indexes_to_issue_categories.rb
index 3f5b2b185..0a6282aa7 100644
--- a/db/migrate/20091017213642_add_missing_indexes_to_issue_categories.rb
+++ b/db/migrate/20091017213642_add_missing_indexes_to_issue_categories.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToIssueCategories < ActiveRecord::Migration
+class AddMissingIndexesToIssueCategories < ActiveRecord::Migration[4.2]
def self.up
add_index :issue_categories, :assigned_to_id
end
diff --git a/db/migrate/20091017213716_add_missing_indexes_to_member_roles.rb b/db/migrate/20091017213716_add_missing_indexes_to_member_roles.rb
index e9ff62db9..fed50d62e 100644
--- a/db/migrate/20091017213716_add_missing_indexes_to_member_roles.rb
+++ b/db/migrate/20091017213716_add_missing_indexes_to_member_roles.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToMemberRoles < ActiveRecord::Migration
+class AddMissingIndexesToMemberRoles < ActiveRecord::Migration[4.2]
def self.up
add_index :member_roles, :member_id
add_index :member_roles, :role_id
diff --git a/db/migrate/20091017213757_add_missing_indexes_to_boards.rb b/db/migrate/20091017213757_add_missing_indexes_to_boards.rb
index d3e94226a..5e5a97af5 100644
--- a/db/migrate/20091017213757_add_missing_indexes_to_boards.rb
+++ b/db/migrate/20091017213757_add_missing_indexes_to_boards.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToBoards < ActiveRecord::Migration
+class AddMissingIndexesToBoards < ActiveRecord::Migration[4.2]
def self.up
add_index :boards, :last_message_id
end
diff --git a/db/migrate/20091017213835_add_missing_indexes_to_user_preferences.rb b/db/migrate/20091017213835_add_missing_indexes_to_user_preferences.rb
index f3a8ccbcb..83a259e59 100644
--- a/db/migrate/20091017213835_add_missing_indexes_to_user_preferences.rb
+++ b/db/migrate/20091017213835_add_missing_indexes_to_user_preferences.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToUserPreferences < ActiveRecord::Migration
+class AddMissingIndexesToUserPreferences < ActiveRecord::Migration[4.2]
def self.up
add_index :user_preferences, :user_id
end
diff --git a/db/migrate/20091017213910_add_missing_indexes_to_issues.rb b/db/migrate/20091017213910_add_missing_indexes_to_issues.rb
index d651a5463..a337ebca8 100644
--- a/db/migrate/20091017213910_add_missing_indexes_to_issues.rb
+++ b/db/migrate/20091017213910_add_missing_indexes_to_issues.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToIssues < ActiveRecord::Migration
+class AddMissingIndexesToIssues < ActiveRecord::Migration[4.2]
def self.up
add_index :issues, :status_id
add_index :issues, :category_id
diff --git a/db/migrate/20091017214015_add_missing_indexes_to_members.rb b/db/migrate/20091017214015_add_missing_indexes_to_members.rb
index 5fdf560fa..693258080 100644
--- a/db/migrate/20091017214015_add_missing_indexes_to_members.rb
+++ b/db/migrate/20091017214015_add_missing_indexes_to_members.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToMembers < ActiveRecord::Migration
+class AddMissingIndexesToMembers < ActiveRecord::Migration[4.2]
def self.up
add_index :members, :user_id
add_index :members, :project_id
diff --git a/db/migrate/20091017214107_add_missing_indexes_to_custom_fields.rb b/db/migrate/20091017214107_add_missing_indexes_to_custom_fields.rb
index 18be0b44b..7dbb0e781 100644
--- a/db/migrate/20091017214107_add_missing_indexes_to_custom_fields.rb
+++ b/db/migrate/20091017214107_add_missing_indexes_to_custom_fields.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToCustomFields < ActiveRecord::Migration
+class AddMissingIndexesToCustomFields < ActiveRecord::Migration[4.2]
def self.up
add_index :custom_fields, [:id, :type]
end
diff --git a/db/migrate/20091017214136_add_missing_indexes_to_queries.rb b/db/migrate/20091017214136_add_missing_indexes_to_queries.rb
index 414b1ad6b..9a8d6ad96 100644
--- a/db/migrate/20091017214136_add_missing_indexes_to_queries.rb
+++ b/db/migrate/20091017214136_add_missing_indexes_to_queries.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToQueries < ActiveRecord::Migration
+class AddMissingIndexesToQueries < ActiveRecord::Migration[4.2]
def self.up
add_index :queries, :project_id
add_index :queries, :user_id
diff --git a/db/migrate/20091017214236_add_missing_indexes_to_time_entries.rb b/db/migrate/20091017214236_add_missing_indexes_to_time_entries.rb
index cffc528ea..cbe4166d5 100644
--- a/db/migrate/20091017214236_add_missing_indexes_to_time_entries.rb
+++ b/db/migrate/20091017214236_add_missing_indexes_to_time_entries.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToTimeEntries < ActiveRecord::Migration
+class AddMissingIndexesToTimeEntries < ActiveRecord::Migration[4.2]
def self.up
add_index :time_entries, :activity_id
add_index :time_entries, :user_id
diff --git a/db/migrate/20091017214308_add_missing_indexes_to_news.rb b/db/migrate/20091017214308_add_missing_indexes_to_news.rb
index 808eb6294..e6194f4e6 100644
--- a/db/migrate/20091017214308_add_missing_indexes_to_news.rb
+++ b/db/migrate/20091017214308_add_missing_indexes_to_news.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToNews < ActiveRecord::Migration
+class AddMissingIndexesToNews < ActiveRecord::Migration[4.2]
def self.up
add_index :news, :author_id
end
diff --git a/db/migrate/20091017214336_add_missing_indexes_to_users.rb b/db/migrate/20091017214336_add_missing_indexes_to_users.rb
index c5a509587..7eedd10fa 100644
--- a/db/migrate/20091017214336_add_missing_indexes_to_users.rb
+++ b/db/migrate/20091017214336_add_missing_indexes_to_users.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToUsers < ActiveRecord::Migration
+class AddMissingIndexesToUsers < ActiveRecord::Migration[4.2]
def self.up
add_index :users, [:id, :type]
add_index :users, :auth_source_id
diff --git a/db/migrate/20091017214406_add_missing_indexes_to_attachments.rb b/db/migrate/20091017214406_add_missing_indexes_to_attachments.rb
index d22fc98ed..7fee1ea2e 100644
--- a/db/migrate/20091017214406_add_missing_indexes_to_attachments.rb
+++ b/db/migrate/20091017214406_add_missing_indexes_to_attachments.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToAttachments < ActiveRecord::Migration
+class AddMissingIndexesToAttachments < ActiveRecord::Migration[4.2]
def self.up
add_index :attachments, [:container_id, :container_type]
add_index :attachments, :author_id
diff --git a/db/migrate/20091017214440_add_missing_indexes_to_wiki_contents.rb b/db/migrate/20091017214440_add_missing_indexes_to_wiki_contents.rb
index 454e4c5d0..47888d4ad 100644
--- a/db/migrate/20091017214440_add_missing_indexes_to_wiki_contents.rb
+++ b/db/migrate/20091017214440_add_missing_indexes_to_wiki_contents.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToWikiContents < ActiveRecord::Migration
+class AddMissingIndexesToWikiContents < ActiveRecord::Migration[4.2]
def self.up
add_index :wiki_contents, :author_id
end
diff --git a/db/migrate/20091017214519_add_missing_indexes_to_custom_values.rb b/db/migrate/20091017214519_add_missing_indexes_to_custom_values.rb
index b192a7e2a..8b83c640d 100644
--- a/db/migrate/20091017214519_add_missing_indexes_to_custom_values.rb
+++ b/db/migrate/20091017214519_add_missing_indexes_to_custom_values.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToCustomValues < ActiveRecord::Migration
+class AddMissingIndexesToCustomValues < ActiveRecord::Migration[4.2]
def self.up
add_index :custom_values, :custom_field_id
end
diff --git a/db/migrate/20091017214611_add_missing_indexes_to_journals.rb b/db/migrate/20091017214611_add_missing_indexes_to_journals.rb
index 2667f4034..26e37bf03 100644
--- a/db/migrate/20091017214611_add_missing_indexes_to_journals.rb
+++ b/db/migrate/20091017214611_add_missing_indexes_to_journals.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToJournals < ActiveRecord::Migration
+class AddMissingIndexesToJournals < ActiveRecord::Migration[4.2]
def self.up
add_index :journals, :user_id
add_index :journals, :journalized_id
diff --git a/db/migrate/20091017214644_add_missing_indexes_to_issue_relations.rb b/db/migrate/20091017214644_add_missing_indexes_to_issue_relations.rb
index fc57f18bf..29de45f62 100644
--- a/db/migrate/20091017214644_add_missing_indexes_to_issue_relations.rb
+++ b/db/migrate/20091017214644_add_missing_indexes_to_issue_relations.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToIssueRelations < ActiveRecord::Migration
+class AddMissingIndexesToIssueRelations < ActiveRecord::Migration[4.2]
def self.up
add_index :issue_relations, :issue_from_id
add_index :issue_relations, :issue_to_id
diff --git a/db/migrate/20091017214720_add_missing_indexes_to_wiki_redirects.rb b/db/migrate/20091017214720_add_missing_indexes_to_wiki_redirects.rb
index 7442a544f..a0ce07f8b 100644
--- a/db/migrate/20091017214720_add_missing_indexes_to_wiki_redirects.rb
+++ b/db/migrate/20091017214720_add_missing_indexes_to_wiki_redirects.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToWikiRedirects < ActiveRecord::Migration
+class AddMissingIndexesToWikiRedirects < ActiveRecord::Migration[4.2]
def self.up
add_index :wiki_redirects, :wiki_id
end
diff --git a/db/migrate/20091017214750_add_missing_indexes_to_custom_fields_trackers.rb b/db/migrate/20091017214750_add_missing_indexes_to_custom_fields_trackers.rb
index c398b7931..23b6e5e4f 100644
--- a/db/migrate/20091017214750_add_missing_indexes_to_custom_fields_trackers.rb
+++ b/db/migrate/20091017214750_add_missing_indexes_to_custom_fields_trackers.rb
@@ -1,4 +1,4 @@
-class AddMissingIndexesToCustomFieldsTrackers < ActiveRecord::Migration
+class AddMissingIndexesToCustomFieldsTrackers < ActiveRecord::Migration[4.2]
def self.up
add_index :custom_fields_trackers, [:custom_field_id, :tracker_id]
end
diff --git a/db/migrate/20091025163651_add_activity_indexes.rb b/db/migrate/20091025163651_add_activity_indexes.rb
index f18059316..0bbf91bfd 100644
--- a/db/migrate/20091025163651_add_activity_indexes.rb
+++ b/db/migrate/20091025163651_add_activity_indexes.rb
@@ -1,4 +1,4 @@
-class AddActivityIndexes < ActiveRecord::Migration
+class AddActivityIndexes < ActiveRecord::Migration[4.2]
def self.up
add_index :journals, :created_on
add_index :changesets, :committed_on
diff --git a/db/migrate/20091108092559_add_versions_status.rb b/db/migrate/20091108092559_add_versions_status.rb
index 99f5f5a0e..36db4d823 100644
--- a/db/migrate/20091108092559_add_versions_status.rb
+++ b/db/migrate/20091108092559_add_versions_status.rb
@@ -1,4 +1,4 @@
-class AddVersionsStatus < ActiveRecord::Migration
+class AddVersionsStatus < ActiveRecord::Migration[4.2]
def self.up
add_column :versions, :status, :string, :default => 'open'
Version.update_all("status = 'open'")
diff --git a/db/migrate/20091114105931_add_view_issues_permission.rb b/db/migrate/20091114105931_add_view_issues_permission.rb
index 6f700cd0c..a0a9bcbf4 100644
--- a/db/migrate/20091114105931_add_view_issues_permission.rb
+++ b/db/migrate/20091114105931_add_view_issues_permission.rb
@@ -1,4 +1,4 @@
-class AddViewIssuesPermission < ActiveRecord::Migration
+class AddViewIssuesPermission < ActiveRecord::Migration[4.2]
def self.up
Role.reset_column_information
Role.all.each do |r|
diff --git a/db/migrate/20091123212029_add_default_done_ratio_to_issue_status.rb b/db/migrate/20091123212029_add_default_done_ratio_to_issue_status.rb
index 0ce672100..2b9df4f17 100644
--- a/db/migrate/20091123212029_add_default_done_ratio_to_issue_status.rb
+++ b/db/migrate/20091123212029_add_default_done_ratio_to_issue_status.rb
@@ -1,4 +1,4 @@
-class AddDefaultDoneRatioToIssueStatus < ActiveRecord::Migration
+class AddDefaultDoneRatioToIssueStatus < ActiveRecord::Migration[4.2]
def self.up
add_column :issue_statuses, :default_done_ratio, :integer
end
diff --git a/db/migrate/20091205124427_add_versions_sharing.rb b/db/migrate/20091205124427_add_versions_sharing.rb
index 3c28e1158..815f9fcda 100644
--- a/db/migrate/20091205124427_add_versions_sharing.rb
+++ b/db/migrate/20091205124427_add_versions_sharing.rb
@@ -1,4 +1,4 @@
-class AddVersionsSharing < ActiveRecord::Migration
+class AddVersionsSharing < ActiveRecord::Migration[4.2]
def self.up
add_column :versions, :sharing, :string, :default => 'none', :null => false
add_index :versions, :sharing
diff --git a/db/migrate/20091220183509_add_lft_and_rgt_indexes_to_projects.rb b/db/migrate/20091220183509_add_lft_and_rgt_indexes_to_projects.rb
index 1c0b4b313..8ec510851 100644
--- a/db/migrate/20091220183509_add_lft_and_rgt_indexes_to_projects.rb
+++ b/db/migrate/20091220183509_add_lft_and_rgt_indexes_to_projects.rb
@@ -1,4 +1,4 @@
-class AddLftAndRgtIndexesToProjects < ActiveRecord::Migration
+class AddLftAndRgtIndexesToProjects < ActiveRecord::Migration[4.2]
def self.up
add_index :projects, :lft
add_index :projects, :rgt
diff --git a/db/migrate/20091220183727_add_index_to_settings_name.rb b/db/migrate/20091220183727_add_index_to_settings_name.rb
index e6c96ec3f..51a33b179 100644
--- a/db/migrate/20091220183727_add_index_to_settings_name.rb
+++ b/db/migrate/20091220183727_add_index_to_settings_name.rb
@@ -1,4 +1,4 @@
-class AddIndexToSettingsName < ActiveRecord::Migration
+class AddIndexToSettingsName < ActiveRecord::Migration[4.2]
def self.up
add_index :settings, :name
end
diff --git a/db/migrate/20091220184736_add_indexes_to_issue_status.rb b/db/migrate/20091220184736_add_indexes_to_issue_status.rb
index 2497a1e6a..9b943518b 100644
--- a/db/migrate/20091220184736_add_indexes_to_issue_status.rb
+++ b/db/migrate/20091220184736_add_indexes_to_issue_status.rb
@@ -1,4 +1,4 @@
-class AddIndexesToIssueStatus < ActiveRecord::Migration
+class AddIndexesToIssueStatus < ActiveRecord::Migration[4.2]
def self.up
add_index :issue_statuses, :position
add_index :issue_statuses, :is_closed
diff --git a/db/migrate/20091225164732_remove_enumerations_opt.rb b/db/migrate/20091225164732_remove_enumerations_opt.rb
index 2a445dd3a..ee39d5b50 100644
--- a/db/migrate/20091225164732_remove_enumerations_opt.rb
+++ b/db/migrate/20091225164732_remove_enumerations_opt.rb
@@ -1,4 +1,4 @@
-class RemoveEnumerationsOpt < ActiveRecord::Migration
+class RemoveEnumerationsOpt < ActiveRecord::Migration[4.2]
def self.up
remove_column :enumerations, :opt
end
diff --git a/db/migrate/20091227112908_change_wiki_contents_text_limit.rb b/db/migrate/20091227112908_change_wiki_contents_text_limit.rb
index 225f71e68..d60a9a846 100644
--- a/db/migrate/20091227112908_change_wiki_contents_text_limit.rb
+++ b/db/migrate/20091227112908_change_wiki_contents_text_limit.rb
@@ -1,4 +1,4 @@
-class ChangeWikiContentsTextLimit < ActiveRecord::Migration
+class ChangeWikiContentsTextLimit < ActiveRecord::Migration[4.2]
def self.up
# Migrates MySQL databases only
# Postgres would raise an error (see http://dev.rubyonrails.org/ticket/3818)
diff --git a/db/migrate/20100129193402_change_users_mail_notification_to_string.rb b/db/migrate/20100129193402_change_users_mail_notification_to_string.rb
index 518a450f4..a31666e39 100644
--- a/db/migrate/20100129193402_change_users_mail_notification_to_string.rb
+++ b/db/migrate/20100129193402_change_users_mail_notification_to_string.rb
@@ -1,4 +1,4 @@
-class ChangeUsersMailNotificationToString < ActiveRecord::Migration
+class ChangeUsersMailNotificationToString < ActiveRecord::Migration[4.2]
def self.up
rename_column :users, :mail_notification, :mail_notification_bool
add_column :users, :mail_notification, :string, :default => '', :null => false
diff --git a/db/migrate/20100129193813_update_mail_notification_values.rb b/db/migrate/20100129193813_update_mail_notification_values.rb
index a8a45ade3..00d3a0478 100644
--- a/db/migrate/20100129193813_update_mail_notification_values.rb
+++ b/db/migrate/20100129193813_update_mail_notification_values.rb
@@ -1,5 +1,5 @@
# Patch the data from a boolean change.
-class UpdateMailNotificationValues < ActiveRecord::Migration
+class UpdateMailNotificationValues < ActiveRecord::Migration[4.2]
def self.up
# No-op
# See 20100129193402_change_users_mail_notification_to_string.rb
diff --git a/db/migrate/20100221100219_add_index_on_changesets_scmid.rb b/db/migrate/20100221100219_add_index_on_changesets_scmid.rb
index 96d85a3a7..cef4be583 100644
--- a/db/migrate/20100221100219_add_index_on_changesets_scmid.rb
+++ b/db/migrate/20100221100219_add_index_on_changesets_scmid.rb
@@ -1,4 +1,4 @@
-class AddIndexOnChangesetsScmid < ActiveRecord::Migration
+class AddIndexOnChangesetsScmid < ActiveRecord::Migration[4.2]
def self.up
add_index :changesets, [:repository_id, :scmid], :name => :changesets_repos_scmid
end
diff --git a/db/migrate/20100313132032_add_issues_nested_sets_columns.rb b/db/migrate/20100313132032_add_issues_nested_sets_columns.rb
index 2467f6f67..a7e5ceeb1 100644
--- a/db/migrate/20100313132032_add_issues_nested_sets_columns.rb
+++ b/db/migrate/20100313132032_add_issues_nested_sets_columns.rb
@@ -1,4 +1,4 @@
-class AddIssuesNestedSetsColumns < ActiveRecord::Migration
+class AddIssuesNestedSetsColumns < ActiveRecord::Migration[4.2]
def self.up
add_column :issues, :parent_id, :integer, :default => nil
add_column :issues, :root_id, :integer, :default => nil
diff --git a/db/migrate/20100313171051_add_index_on_issues_nested_set.rb b/db/migrate/20100313171051_add_index_on_issues_nested_set.rb
index 4dc948000..b624c2249 100644
--- a/db/migrate/20100313171051_add_index_on_issues_nested_set.rb
+++ b/db/migrate/20100313171051_add_index_on_issues_nested_set.rb
@@ -1,4 +1,4 @@
-class AddIndexOnIssuesNestedSet < ActiveRecord::Migration
+class AddIndexOnIssuesNestedSet < ActiveRecord::Migration[4.2]
def self.up
add_index :issues, [:root_id, :lft, :rgt]
end
diff --git a/db/migrate/20100705164950_change_changes_path_length_limit.rb b/db/migrate/20100705164950_change_changes_path_length_limit.rb
index e00b69d08..f40ca0852 100644
--- a/db/migrate/20100705164950_change_changes_path_length_limit.rb
+++ b/db/migrate/20100705164950_change_changes_path_length_limit.rb
@@ -1,4 +1,4 @@
-class ChangeChangesPathLengthLimit < ActiveRecord::Migration
+class ChangeChangesPathLengthLimit < ActiveRecord::Migration[4.2]
def self.up
# these are two steps to please MySQL 5 on Win32
change_column :changes, :path, :text, :default => nil, :null => true
diff --git a/db/migrate/20100819172912_enable_calendar_and_gantt_modules_where_appropriate.rb b/db/migrate/20100819172912_enable_calendar_and_gantt_modules_where_appropriate.rb
index 6071adf52..2e178e549 100644
--- a/db/migrate/20100819172912_enable_calendar_and_gantt_modules_where_appropriate.rb
+++ b/db/migrate/20100819172912_enable_calendar_and_gantt_modules_where_appropriate.rb
@@ -1,4 +1,4 @@
-class EnableCalendarAndGanttModulesWhereAppropriate < ActiveRecord::Migration
+class EnableCalendarAndGanttModulesWhereAppropriate < ActiveRecord::Migration[4.2]
def self.up
EnabledModule.where(:name => 'issue_tracking').each do |e|
EnabledModule.create(:name => 'calendar', :project_id => e.project_id)
diff --git a/db/migrate/20101104182107_add_unique_index_on_members.rb b/db/migrate/20101104182107_add_unique_index_on_members.rb
index eabdad86b..a29fc75b8 100644
--- a/db/migrate/20101104182107_add_unique_index_on_members.rb
+++ b/db/migrate/20101104182107_add_unique_index_on_members.rb
@@ -1,4 +1,4 @@
-class AddUniqueIndexOnMembers < ActiveRecord::Migration
+class AddUniqueIndexOnMembers < ActiveRecord::Migration[4.2]
def self.up
# Clean and reassign MemberRole rows if needed
MemberRole.where("member_id NOT IN (SELECT id FROM #{Member.table_name})").delete_all
diff --git a/db/migrate/20101107130441_add_custom_fields_visible.rb b/db/migrate/20101107130441_add_custom_fields_visible.rb
index 9d59faee5..d3edb145f 100644
--- a/db/migrate/20101107130441_add_custom_fields_visible.rb
+++ b/db/migrate/20101107130441_add_custom_fields_visible.rb
@@ -1,4 +1,4 @@
-class AddCustomFieldsVisible < ActiveRecord::Migration
+class AddCustomFieldsVisible < ActiveRecord::Migration[4.2]
def self.up
add_column :custom_fields, :visible, :boolean, :null => false, :default => true
CustomField.update_all("visible = #{CustomField.connection.quoted_true}")
diff --git a/db/migrate/20101114115114_change_projects_name_limit.rb b/db/migrate/20101114115114_change_projects_name_limit.rb
index fabc3c9d8..e731a005d 100644
--- a/db/migrate/20101114115114_change_projects_name_limit.rb
+++ b/db/migrate/20101114115114_change_projects_name_limit.rb
@@ -1,4 +1,4 @@
-class ChangeProjectsNameLimit < ActiveRecord::Migration
+class ChangeProjectsNameLimit < ActiveRecord::Migration[4.2]
def self.up
change_column :projects, :name, :string, :limit => nil, :default => '', :null => false
end
diff --git a/db/migrate/20101114115359_change_projects_identifier_limit.rb b/db/migrate/20101114115359_change_projects_identifier_limit.rb
index 79426fadf..1e2bb6e1c 100644
--- a/db/migrate/20101114115359_change_projects_identifier_limit.rb
+++ b/db/migrate/20101114115359_change_projects_identifier_limit.rb
@@ -1,4 +1,4 @@
-class ChangeProjectsIdentifierLimit < ActiveRecord::Migration
+class ChangeProjectsIdentifierLimit < ActiveRecord::Migration[4.2]
def self.up
change_column :projects, :identifier, :string, :limit => nil
end
diff --git a/db/migrate/20110220160626_add_workflows_assignee_and_author.rb b/db/migrate/20110220160626_add_workflows_assignee_and_author.rb
index 448ac6302..5b04bd950 100644
--- a/db/migrate/20110220160626_add_workflows_assignee_and_author.rb
+++ b/db/migrate/20110220160626_add_workflows_assignee_and_author.rb
@@ -1,4 +1,4 @@
-class AddWorkflowsAssigneeAndAuthor < ActiveRecord::Migration
+class AddWorkflowsAssigneeAndAuthor < ActiveRecord::Migration[4.2]
def self.up
add_column :workflows, :assignee, :boolean, :null => false, :default => false
add_column :workflows, :author, :boolean, :null => false, :default => false
diff --git a/db/migrate/20110223180944_add_users_salt.rb b/db/migrate/20110223180944_add_users_salt.rb
index f1cf6483f..5fda33479 100644
--- a/db/migrate/20110223180944_add_users_salt.rb
+++ b/db/migrate/20110223180944_add_users_salt.rb
@@ -1,4 +1,4 @@
-class AddUsersSalt < ActiveRecord::Migration
+class AddUsersSalt < ActiveRecord::Migration[4.2]
def self.up
add_column :users, :salt, :string, :limit => 64
end
diff --git a/db/migrate/20110223180953_salt_user_passwords.rb b/db/migrate/20110223180953_salt_user_passwords.rb
index 9f017db9c..007691b90 100644
--- a/db/migrate/20110223180953_salt_user_passwords.rb
+++ b/db/migrate/20110223180953_salt_user_passwords.rb
@@ -1,4 +1,4 @@
-class SaltUserPasswords < ActiveRecord::Migration
+class SaltUserPasswords < ActiveRecord::Migration[4.2]
def self.up
say_with_time "Salting user passwords, this may take some time..." do
diff --git a/db/migrate/20110224000000_add_repositories_path_encoding.rb b/db/migrate/20110224000000_add_repositories_path_encoding.rb
index 253d7a66e..23c16d26d 100644
--- a/db/migrate/20110224000000_add_repositories_path_encoding.rb
+++ b/db/migrate/20110224000000_add_repositories_path_encoding.rb
@@ -1,4 +1,4 @@
-class AddRepositoriesPathEncoding < ActiveRecord::Migration
+class AddRepositoriesPathEncoding < ActiveRecord::Migration[4.2]
def self.up
add_column :repositories, :path_encoding, :string, :limit => 64, :default => nil
end
diff --git a/db/migrate/20110226120112_change_repositories_password_limit.rb b/db/migrate/20110226120112_change_repositories_password_limit.rb
index 1ad937c7d..5eb41f588 100644
--- a/db/migrate/20110226120112_change_repositories_password_limit.rb
+++ b/db/migrate/20110226120112_change_repositories_password_limit.rb
@@ -1,4 +1,4 @@
-class ChangeRepositoriesPasswordLimit < ActiveRecord::Migration
+class ChangeRepositoriesPasswordLimit < ActiveRecord::Migration[4.2]
def self.up
change_column :repositories, :password, :string, :limit => nil, :default => ''
end
diff --git a/db/migrate/20110226120132_change_auth_sources_account_password_limit.rb b/db/migrate/20110226120132_change_auth_sources_account_password_limit.rb
index b1cd80aa5..fac820b17 100644
--- a/db/migrate/20110226120132_change_auth_sources_account_password_limit.rb
+++ b/db/migrate/20110226120132_change_auth_sources_account_password_limit.rb
@@ -1,4 +1,4 @@
-class ChangeAuthSourcesAccountPasswordLimit < ActiveRecord::Migration
+class ChangeAuthSourcesAccountPasswordLimit < ActiveRecord::Migration[4.2]
def self.up
change_column :auth_sources, :account_password, :string, :limit => nil, :default => ''
end
diff --git a/db/migrate/20110227125750_change_journal_details_values_to_text.rb b/db/migrate/20110227125750_change_journal_details_values_to_text.rb
index 25886575c..36dd7b5d1 100644
--- a/db/migrate/20110227125750_change_journal_details_values_to_text.rb
+++ b/db/migrate/20110227125750_change_journal_details_values_to_text.rb
@@ -1,4 +1,4 @@
-class ChangeJournalDetailsValuesToText < ActiveRecord::Migration
+class ChangeJournalDetailsValuesToText < ActiveRecord::Migration[4.2]
def self.up
change_column :journal_details, :old_value, :text
change_column :journal_details, :value, :text
diff --git a/db/migrate/20110228000000_add_repositories_log_encoding.rb b/db/migrate/20110228000000_add_repositories_log_encoding.rb
index 85cadafce..7201f74bf 100644
--- a/db/migrate/20110228000000_add_repositories_log_encoding.rb
+++ b/db/migrate/20110228000000_add_repositories_log_encoding.rb
@@ -1,4 +1,4 @@
-class AddRepositoriesLogEncoding < ActiveRecord::Migration
+class AddRepositoriesLogEncoding < ActiveRecord::Migration[4.2]
def self.up
add_column :repositories, :log_encoding, :string, :limit => 64, :default => nil
end
diff --git a/db/migrate/20110228000100_copy_repositories_log_encoding.rb b/db/migrate/20110228000100_copy_repositories_log_encoding.rb
index 48d387138..df9c3dca5 100644
--- a/db/migrate/20110228000100_copy_repositories_log_encoding.rb
+++ b/db/migrate/20110228000100_copy_repositories_log_encoding.rb
@@ -1,4 +1,4 @@
-class CopyRepositoriesLogEncoding < ActiveRecord::Migration
+class CopyRepositoriesLogEncoding < ActiveRecord::Migration[4.2]
def self.up
encoding = Setting.commit_logs_encoding.to_s.strip
encoding = encoding.blank? ? 'UTF-8' : encoding
diff --git a/db/migrate/20110401192910_add_index_to_users_type.rb b/db/migrate/20110401192910_add_index_to_users_type.rb
index b9f501120..63fc49652 100644
--- a/db/migrate/20110401192910_add_index_to_users_type.rb
+++ b/db/migrate/20110401192910_add_index_to_users_type.rb
@@ -1,4 +1,4 @@
-class AddIndexToUsersType < ActiveRecord::Migration
+class AddIndexToUsersType < ActiveRecord::Migration[4.2]
def self.up
add_index :users, :type
end
diff --git a/db/migrate/20110408103312_add_roles_issues_visibility.rb b/db/migrate/20110408103312_add_roles_issues_visibility.rb
index 1e6b29a64..4f07e25ed 100644
--- a/db/migrate/20110408103312_add_roles_issues_visibility.rb
+++ b/db/migrate/20110408103312_add_roles_issues_visibility.rb
@@ -1,4 +1,4 @@
-class AddRolesIssuesVisibility < ActiveRecord::Migration
+class AddRolesIssuesVisibility < ActiveRecord::Migration[4.2]
def self.up
add_column :roles, :issues_visibility, :string, :limit => 30, :default => 'default', :null => false
end
diff --git a/db/migrate/20110412065600_add_issues_is_private.rb b/db/migrate/20110412065600_add_issues_is_private.rb
index 2cc4e4b15..0066225b0 100644
--- a/db/migrate/20110412065600_add_issues_is_private.rb
+++ b/db/migrate/20110412065600_add_issues_is_private.rb
@@ -1,4 +1,4 @@
-class AddIssuesIsPrivate < ActiveRecord::Migration
+class AddIssuesIsPrivate < ActiveRecord::Migration[4.2]
def self.up
add_column :issues, :is_private, :boolean, :default => false, :null => false
end
diff --git a/db/migrate/20110511000000_add_repositories_extra_info.rb b/db/migrate/20110511000000_add_repositories_extra_info.rb
index a5280dc57..60ab175bf 100644
--- a/db/migrate/20110511000000_add_repositories_extra_info.rb
+++ b/db/migrate/20110511000000_add_repositories_extra_info.rb
@@ -1,4 +1,4 @@
-class AddRepositoriesExtraInfo < ActiveRecord::Migration
+class AddRepositoriesExtraInfo < ActiveRecord::Migration[4.2]
def self.up
add_column :repositories, :extra_info, :text
end
diff --git a/db/migrate/20110902000000_create_changeset_parents.rb b/db/migrate/20110902000000_create_changeset_parents.rb
index e679d3f91..1f367e606 100644
--- a/db/migrate/20110902000000_create_changeset_parents.rb
+++ b/db/migrate/20110902000000_create_changeset_parents.rb
@@ -1,4 +1,4 @@
-class CreateChangesetParents < ActiveRecord::Migration
+class CreateChangesetParents < ActiveRecord::Migration[4.2]
def self.up
create_table :changeset_parents, :id => false do |t|
t.column :changeset_id, :integer, :null => false
diff --git a/db/migrate/20111201201315_add_unique_index_to_issue_relations.rb b/db/migrate/20111201201315_add_unique_index_to_issue_relations.rb
index 1bee49ab0..63e6af87b 100644
--- a/db/migrate/20111201201315_add_unique_index_to_issue_relations.rb
+++ b/db/migrate/20111201201315_add_unique_index_to_issue_relations.rb
@@ -1,4 +1,4 @@
-class AddUniqueIndexToIssueRelations < ActiveRecord::Migration
+class AddUniqueIndexToIssueRelations < ActiveRecord::Migration[4.2]
def self.up
# Remove duplicates
diff --git a/db/migrate/20120115143024_add_repositories_identifier.rb b/db/migrate/20120115143024_add_repositories_identifier.rb
index b54ebd1d5..28af22120 100644
--- a/db/migrate/20120115143024_add_repositories_identifier.rb
+++ b/db/migrate/20120115143024_add_repositories_identifier.rb
@@ -1,4 +1,4 @@
-class AddRepositoriesIdentifier < ActiveRecord::Migration
+class AddRepositoriesIdentifier < ActiveRecord::Migration[4.2]
def self.up
add_column :repositories, :identifier, :string
end
diff --git a/db/migrate/20120115143100_add_repositories_is_default.rb b/db/migrate/20120115143100_add_repositories_is_default.rb
index 87f018120..81c242b5e 100644
--- a/db/migrate/20120115143100_add_repositories_is_default.rb
+++ b/db/migrate/20120115143100_add_repositories_is_default.rb
@@ -1,4 +1,4 @@
-class AddRepositoriesIsDefault < ActiveRecord::Migration
+class AddRepositoriesIsDefault < ActiveRecord::Migration[4.2]
def self.up
add_column :repositories, :is_default, :boolean, :default => false
end
diff --git a/db/migrate/20120115143126_set_default_repositories.rb b/db/migrate/20120115143126_set_default_repositories.rb
index 38e06f0ad..e99b30725 100644
--- a/db/migrate/20120115143126_set_default_repositories.rb
+++ b/db/migrate/20120115143126_set_default_repositories.rb
@@ -1,4 +1,4 @@
-class SetDefaultRepositories < ActiveRecord::Migration
+class SetDefaultRepositories < ActiveRecord::Migration[4.2]
def self.up
Repository.update_all(["is_default = ?", false])
# Sets the last repository as default in case multiple repositories exist for the same project
diff --git a/db/migrate/20120127174243_add_custom_fields_multiple.rb b/db/migrate/20120127174243_add_custom_fields_multiple.rb
index caee40bd4..608fa6259 100644
--- a/db/migrate/20120127174243_add_custom_fields_multiple.rb
+++ b/db/migrate/20120127174243_add_custom_fields_multiple.rb
@@ -1,4 +1,4 @@
-class AddCustomFieldsMultiple < ActiveRecord::Migration
+class AddCustomFieldsMultiple < ActiveRecord::Migration[4.2]
def self.up
add_column :custom_fields, :multiple, :boolean, :default => false
end
diff --git a/db/migrate/20120205111326_change_users_login_limit.rb b/db/migrate/20120205111326_change_users_login_limit.rb
index 4508a5c40..6f3c08b1f 100644
--- a/db/migrate/20120205111326_change_users_login_limit.rb
+++ b/db/migrate/20120205111326_change_users_login_limit.rb
@@ -1,4 +1,4 @@
-class ChangeUsersLoginLimit < ActiveRecord::Migration
+class ChangeUsersLoginLimit < ActiveRecord::Migration[4.2]
def self.up
change_column :users, :login, :string, :limit => nil, :default => '', :null => false
end
diff --git a/db/migrate/20120223110929_change_attachments_container_defaults.rb b/db/migrate/20120223110929_change_attachments_container_defaults.rb
index be720aafa..3c48276a1 100644
--- a/db/migrate/20120223110929_change_attachments_container_defaults.rb
+++ b/db/migrate/20120223110929_change_attachments_container_defaults.rb
@@ -1,4 +1,4 @@
-class ChangeAttachmentsContainerDefaults < ActiveRecord::Migration
+class ChangeAttachmentsContainerDefaults < ActiveRecord::Migration[4.2]
def self.up
# Need to drop the index otherwise the following error occurs in Rails 3.1.3:
#
diff --git a/db/migrate/20120301153455_add_auth_sources_filter.rb b/db/migrate/20120301153455_add_auth_sources_filter.rb
index 617b3b77e..8538f4da2 100644
--- a/db/migrate/20120301153455_add_auth_sources_filter.rb
+++ b/db/migrate/20120301153455_add_auth_sources_filter.rb
@@ -1,4 +1,4 @@
-class AddAuthSourcesFilter < ActiveRecord::Migration
+class AddAuthSourcesFilter < ActiveRecord::Migration[4.2]
def self.up
add_column :auth_sources, :filter, :string
end
diff --git a/db/migrate/20120422150750_change_repositories_to_full_sti.rb b/db/migrate/20120422150750_change_repositories_to_full_sti.rb
index d0de7bac7..101ecbc12 100644
--- a/db/migrate/20120422150750_change_repositories_to_full_sti.rb
+++ b/db/migrate/20120422150750_change_repositories_to_full_sti.rb
@@ -1,4 +1,4 @@
-class ChangeRepositoriesToFullSti < ActiveRecord::Migration
+class ChangeRepositoriesToFullSti < ActiveRecord::Migration[4.2]
def up
Repository.connection.
select_rows("SELECT id, type FROM #{Repository.table_name}").
diff --git a/db/migrate/20120705074331_add_trackers_fields_bits.rb b/db/migrate/20120705074331_add_trackers_fields_bits.rb
index 5d8458382..90e2ca1fe 100644
--- a/db/migrate/20120705074331_add_trackers_fields_bits.rb
+++ b/db/migrate/20120705074331_add_trackers_fields_bits.rb
@@ -1,4 +1,4 @@
-class AddTrackersFieldsBits < ActiveRecord::Migration
+class AddTrackersFieldsBits < ActiveRecord::Migration[4.2]
def self.up
add_column :trackers, :fields_bits, :integer, :default => 0
end
diff --git a/db/migrate/20120707064544_add_auth_sources_timeout.rb b/db/migrate/20120707064544_add_auth_sources_timeout.rb
index 40f467810..4491bc35b 100644
--- a/db/migrate/20120707064544_add_auth_sources_timeout.rb
+++ b/db/migrate/20120707064544_add_auth_sources_timeout.rb
@@ -1,4 +1,4 @@
-class AddAuthSourcesTimeout < ActiveRecord::Migration
+class AddAuthSourcesTimeout < ActiveRecord::Migration[4.2]
def up
add_column :auth_sources, :timeout, :integer
end
diff --git a/db/migrate/20120714122000_add_workflows_type.rb b/db/migrate/20120714122000_add_workflows_type.rb
index f263f25df..6e2ffb6a4 100644
--- a/db/migrate/20120714122000_add_workflows_type.rb
+++ b/db/migrate/20120714122000_add_workflows_type.rb
@@ -1,4 +1,4 @@
-class AddWorkflowsType < ActiveRecord::Migration
+class AddWorkflowsType < ActiveRecord::Migration[4.2]
def up
add_column :workflows, :type, :string, :limit => 30
end
diff --git a/db/migrate/20120714122100_update_workflows_to_sti.rb b/db/migrate/20120714122100_update_workflows_to_sti.rb
index 8ee5c6dc3..a5da4ba7a 100644
--- a/db/migrate/20120714122100_update_workflows_to_sti.rb
+++ b/db/migrate/20120714122100_update_workflows_to_sti.rb
@@ -1,4 +1,4 @@
-class UpdateWorkflowsToSti < ActiveRecord::Migration
+class UpdateWorkflowsToSti < ActiveRecord::Migration[4.2]
def up
WorkflowRule.update_all "type = 'WorkflowTransition'"
end
diff --git a/db/migrate/20120714122200_add_workflows_rule_fields.rb b/db/migrate/20120714122200_add_workflows_rule_fields.rb
index 6e9c7df70..aff919bf6 100644
--- a/db/migrate/20120714122200_add_workflows_rule_fields.rb
+++ b/db/migrate/20120714122200_add_workflows_rule_fields.rb
@@ -1,4 +1,4 @@
-class AddWorkflowsRuleFields < ActiveRecord::Migration
+class AddWorkflowsRuleFields < ActiveRecord::Migration[4.2]
def up
add_column :workflows, :field_name, :string, :limit => 30
add_column :workflows, :rule, :string, :limit => 30
diff --git a/db/migrate/20120731164049_add_boards_parent_id.rb b/db/migrate/20120731164049_add_boards_parent_id.rb
index c9ce47f78..f67468426 100644
--- a/db/migrate/20120731164049_add_boards_parent_id.rb
+++ b/db/migrate/20120731164049_add_boards_parent_id.rb
@@ -1,4 +1,4 @@
-class AddBoardsParentId < ActiveRecord::Migration
+class AddBoardsParentId < ActiveRecord::Migration[4.2]
def up
add_column :boards, :parent_id, :integer
end
diff --git a/db/migrate/20120930112914_add_journals_private_notes.rb b/db/migrate/20120930112914_add_journals_private_notes.rb
index 41eb0e9ef..265d2516c 100644
--- a/db/migrate/20120930112914_add_journals_private_notes.rb
+++ b/db/migrate/20120930112914_add_journals_private_notes.rb
@@ -1,4 +1,4 @@
-class AddJournalsPrivateNotes < ActiveRecord::Migration
+class AddJournalsPrivateNotes < ActiveRecord::Migration[4.2]
def up
add_column :journals, :private_notes, :boolean, :default => false, :null => false
end
diff --git a/db/migrate/20121026002032_add_enumerations_position_name.rb b/db/migrate/20121026002032_add_enumerations_position_name.rb
index 52cbe08eb..eb5423fee 100644
--- a/db/migrate/20121026002032_add_enumerations_position_name.rb
+++ b/db/migrate/20121026002032_add_enumerations_position_name.rb
@@ -1,4 +1,4 @@
-class AddEnumerationsPositionName < ActiveRecord::Migration
+class AddEnumerationsPositionName < ActiveRecord::Migration[4.2]
def up
add_column :enumerations, :position_name, :string, :limit => 30
end
diff --git a/db/migrate/20121026003537_populate_enumerations_position_name.rb b/db/migrate/20121026003537_populate_enumerations_position_name.rb
index 31777b75f..d4f1807ca 100644
--- a/db/migrate/20121026003537_populate_enumerations_position_name.rb
+++ b/db/migrate/20121026003537_populate_enumerations_position_name.rb
@@ -1,4 +1,4 @@
-class PopulateEnumerationsPositionName < ActiveRecord::Migration
+class PopulateEnumerationsPositionName < ActiveRecord::Migration[4.2]
def up
IssuePriority.compute_position_names
end
diff --git a/db/migrate/20121209123234_add_queries_type.rb b/db/migrate/20121209123234_add_queries_type.rb
index 202d524e1..fdfaac410 100644
--- a/db/migrate/20121209123234_add_queries_type.rb
+++ b/db/migrate/20121209123234_add_queries_type.rb
@@ -1,4 +1,4 @@
-class AddQueriesType < ActiveRecord::Migration
+class AddQueriesType < ActiveRecord::Migration[4.2]
def up
add_column :queries, :type, :string
end
diff --git a/db/migrate/20121209123358_update_queries_to_sti.rb b/db/migrate/20121209123358_update_queries_to_sti.rb
index d8dea4070..088b8ca84 100644
--- a/db/migrate/20121209123358_update_queries_to_sti.rb
+++ b/db/migrate/20121209123358_update_queries_to_sti.rb
@@ -1,4 +1,4 @@
-class UpdateQueriesToSti < ActiveRecord::Migration
+class UpdateQueriesToSti < ActiveRecord::Migration[4.2]
def up
::Query.update_all :type => 'IssueQuery'
end
diff --git a/db/migrate/20121213084931_add_attachments_disk_directory.rb b/db/migrate/20121213084931_add_attachments_disk_directory.rb
index d11fcad9b..dc3458028 100644
--- a/db/migrate/20121213084931_add_attachments_disk_directory.rb
+++ b/db/migrate/20121213084931_add_attachments_disk_directory.rb
@@ -1,4 +1,4 @@
-class AddAttachmentsDiskDirectory < ActiveRecord::Migration
+class AddAttachmentsDiskDirectory < ActiveRecord::Migration[4.2]
def up
add_column :attachments, :disk_directory, :string
end
diff --git a/db/migrate/20130110122628_split_documents_permissions.rb b/db/migrate/20130110122628_split_documents_permissions.rb
index 0e010aa5c..f52b8e4cd 100644
--- a/db/migrate/20130110122628_split_documents_permissions.rb
+++ b/db/migrate/20130110122628_split_documents_permissions.rb
@@ -1,4 +1,4 @@
-class SplitDocumentsPermissions < ActiveRecord::Migration
+class SplitDocumentsPermissions < ActiveRecord::Migration[4.2]
def up
# :manage_documents permission split into 3 permissions:
# :add_documents, :edit_documents and :delete_documents
diff --git a/db/migrate/20130201184705_add_unique_index_on_tokens_value.rb b/db/migrate/20130201184705_add_unique_index_on_tokens_value.rb
index fdec9f8ee..4413e4e3b 100644
--- a/db/migrate/20130201184705_add_unique_index_on_tokens_value.rb
+++ b/db/migrate/20130201184705_add_unique_index_on_tokens_value.rb
@@ -1,4 +1,4 @@
-class AddUniqueIndexOnTokensValue < ActiveRecord::Migration
+class AddUniqueIndexOnTokensValue < ActiveRecord::Migration[4.2]
def up
say_with_time "Adding unique index on tokens, this may take some time..." do
# Just in case
diff --git a/db/migrate/20130202090625_add_projects_inherit_members.rb b/db/migrate/20130202090625_add_projects_inherit_members.rb
index 9cf5bade3..629ad4565 100644
--- a/db/migrate/20130202090625_add_projects_inherit_members.rb
+++ b/db/migrate/20130202090625_add_projects_inherit_members.rb
@@ -1,4 +1,4 @@
-class AddProjectsInheritMembers < ActiveRecord::Migration
+class AddProjectsInheritMembers < ActiveRecord::Migration[4.2]
def up
add_column :projects, :inherit_members, :boolean, :default => false, :null => false
end
diff --git a/db/migrate/20130207175206_add_unique_index_on_custom_fields_trackers.rb b/db/migrate/20130207175206_add_unique_index_on_custom_fields_trackers.rb
index 9977dcd50..3353803ab 100644
--- a/db/migrate/20130207175206_add_unique_index_on_custom_fields_trackers.rb
+++ b/db/migrate/20130207175206_add_unique_index_on_custom_fields_trackers.rb
@@ -1,4 +1,4 @@
-class AddUniqueIndexOnCustomFieldsTrackers < ActiveRecord::Migration
+class AddUniqueIndexOnCustomFieldsTrackers < ActiveRecord::Migration[4.2]
def up
table_name = "#{CustomField.table_name_prefix}custom_fields_trackers#{CustomField.table_name_suffix}"
duplicates = CustomField.connection.select_rows("SELECT custom_field_id, tracker_id FROM #{table_name} GROUP BY custom_field_id, tracker_id HAVING COUNT(*) > 1")
diff --git a/db/migrate/20130207181455_add_unique_index_on_custom_fields_projects.rb b/db/migrate/20130207181455_add_unique_index_on_custom_fields_projects.rb
index 223818d4f..2198aed77 100644
--- a/db/migrate/20130207181455_add_unique_index_on_custom_fields_projects.rb
+++ b/db/migrate/20130207181455_add_unique_index_on_custom_fields_projects.rb
@@ -1,4 +1,4 @@
-class AddUniqueIndexOnCustomFieldsProjects < ActiveRecord::Migration
+class AddUniqueIndexOnCustomFieldsProjects < ActiveRecord::Migration[4.2]
def up
table_name = "#{CustomField.table_name_prefix}custom_fields_projects#{CustomField.table_name_suffix}"
duplicates = CustomField.connection.select_rows("SELECT custom_field_id, project_id FROM #{table_name} GROUP BY custom_field_id, project_id HAVING COUNT(*) > 1")
diff --git a/db/migrate/20130215073721_change_users_lastname_length_to_255.rb b/db/migrate/20130215073721_change_users_lastname_length_to_255.rb
index 7d68e37d8..02939aadb 100644
--- a/db/migrate/20130215073721_change_users_lastname_length_to_255.rb
+++ b/db/migrate/20130215073721_change_users_lastname_length_to_255.rb
@@ -1,4 +1,4 @@
-class ChangeUsersLastnameLengthTo255 < ActiveRecord::Migration
+class ChangeUsersLastnameLengthTo255 < ActiveRecord::Migration[4.2]
def self.up
change_column :users, :lastname, :string, :limit => 255, :default => '', :null => false
end
diff --git a/db/migrate/20130215111127_add_issues_closed_on.rb b/db/migrate/20130215111127_add_issues_closed_on.rb
index 2670deba5..f719b0d21 100644
--- a/db/migrate/20130215111127_add_issues_closed_on.rb
+++ b/db/migrate/20130215111127_add_issues_closed_on.rb
@@ -1,4 +1,4 @@
-class AddIssuesClosedOn < ActiveRecord::Migration
+class AddIssuesClosedOn < ActiveRecord::Migration[4.2]
def up
add_column :issues, :closed_on, :datetime, :default => nil
end
diff --git a/db/migrate/20130215111141_populate_issues_closed_on.rb b/db/migrate/20130215111141_populate_issues_closed_on.rb
index 19313d4c8..009573837 100644
--- a/db/migrate/20130215111141_populate_issues_closed_on.rb
+++ b/db/migrate/20130215111141_populate_issues_closed_on.rb
@@ -1,4 +1,4 @@
-class PopulateIssuesClosedOn < ActiveRecord::Migration
+class PopulateIssuesClosedOn < ActiveRecord::Migration[4.2]
def up
closed_status_ids = IssueStatus.where(:is_closed => true).pluck(:id)
if closed_status_ids.any?
diff --git a/db/migrate/20130217094251_remove_issues_default_fk_values.rb b/db/migrate/20130217094251_remove_issues_default_fk_values.rb
index 9345cf0b8..e2cea2160 100644
--- a/db/migrate/20130217094251_remove_issues_default_fk_values.rb
+++ b/db/migrate/20130217094251_remove_issues_default_fk_values.rb
@@ -1,4 +1,4 @@
-class RemoveIssuesDefaultFkValues < ActiveRecord::Migration
+class RemoveIssuesDefaultFkValues < ActiveRecord::Migration[4.2]
def up
change_column_default :issues, :tracker_id, nil
change_column_default :issues, :project_id, nil
diff --git a/db/migrate/20130602092539_create_queries_roles.rb b/db/migrate/20130602092539_create_queries_roles.rb
index 7713a7a36..f37c26bbf 100644
--- a/db/migrate/20130602092539_create_queries_roles.rb
+++ b/db/migrate/20130602092539_create_queries_roles.rb
@@ -1,4 +1,4 @@
-class CreateQueriesRoles < ActiveRecord::Migration
+class CreateQueriesRoles < ActiveRecord::Migration[4.2]
def self.up
create_table :queries_roles, :id => false do |t|
t.column :query_id, :integer, :null => false
diff --git a/db/migrate/20130710182539_add_queries_visibility.rb b/db/migrate/20130710182539_add_queries_visibility.rb
index d6cd1a7b3..36f298d11 100644
--- a/db/migrate/20130710182539_add_queries_visibility.rb
+++ b/db/migrate/20130710182539_add_queries_visibility.rb
@@ -1,4 +1,4 @@
-class AddQueriesVisibility < ActiveRecord::Migration
+class AddQueriesVisibility < ActiveRecord::Migration[4.2]
def up
add_column :queries, :visibility, :integer, :default => 0
Query.where(:is_public => true).update_all(:visibility => 2)
diff --git a/db/migrate/20130713104233_create_custom_fields_roles.rb b/db/migrate/20130713104233_create_custom_fields_roles.rb
index e9eeccc17..c34a123c1 100644
--- a/db/migrate/20130713104233_create_custom_fields_roles.rb
+++ b/db/migrate/20130713104233_create_custom_fields_roles.rb
@@ -1,4 +1,4 @@
-class CreateCustomFieldsRoles < ActiveRecord::Migration
+class CreateCustomFieldsRoles < ActiveRecord::Migration[4.2]
def self.up
create_table :custom_fields_roles, :id => false do |t|
t.column :custom_field_id, :integer, :null => false
diff --git a/db/migrate/20130713111657_add_queries_options.rb b/db/migrate/20130713111657_add_queries_options.rb
index f203b11c4..9bd5834aa 100644
--- a/db/migrate/20130713111657_add_queries_options.rb
+++ b/db/migrate/20130713111657_add_queries_options.rb
@@ -1,4 +1,4 @@
-class AddQueriesOptions < ActiveRecord::Migration
+class AddQueriesOptions < ActiveRecord::Migration[4.2]
def up
add_column :queries, :options, :text
end
diff --git a/db/migrate/20130729070143_add_users_must_change_passwd.rb b/db/migrate/20130729070143_add_users_must_change_passwd.rb
index 13c29292e..3a5860fe0 100644
--- a/db/migrate/20130729070143_add_users_must_change_passwd.rb
+++ b/db/migrate/20130729070143_add_users_must_change_passwd.rb
@@ -1,4 +1,4 @@
-class AddUsersMustChangePasswd < ActiveRecord::Migration
+class AddUsersMustChangePasswd < ActiveRecord::Migration[4.2]
def up
add_column :users, :must_change_passwd, :boolean, :default => false, :null => false
end
diff --git a/db/migrate/20130911193200_remove_eols_from_attachments_filename.rb b/db/migrate/20130911193200_remove_eols_from_attachments_filename.rb
index d2f828170..3eafd3399 100644
--- a/db/migrate/20130911193200_remove_eols_from_attachments_filename.rb
+++ b/db/migrate/20130911193200_remove_eols_from_attachments_filename.rb
@@ -1,4 +1,4 @@
-class RemoveEolsFromAttachmentsFilename < ActiveRecord::Migration
+class RemoveEolsFromAttachmentsFilename < ActiveRecord::Migration[4.2]
def up
Attachment.where("filename like ? or filename like ?", "%\r%", "%\n%").each do |attachment|
filename = attachment.filename.to_s.tr("\r\n", "_")
diff --git a/db/migrate/20131004113137_support_for_multiple_commit_keywords.rb b/db/migrate/20131004113137_support_for_multiple_commit_keywords.rb
index 36104285b..d8beb4aea 100644
--- a/db/migrate/20131004113137_support_for_multiple_commit_keywords.rb
+++ b/db/migrate/20131004113137_support_for_multiple_commit_keywords.rb
@@ -1,4 +1,4 @@
-class SupportForMultipleCommitKeywords < ActiveRecord::Migration
+class SupportForMultipleCommitKeywords < ActiveRecord::Migration[4.2]
def up
# Replaces commit_fix_keywords, commit_fix_status_id, commit_fix_done_ratio settings
# with commit_update_keywords setting
diff --git a/db/migrate/20131005100610_add_repositories_created_on.rb b/db/migrate/20131005100610_add_repositories_created_on.rb
index 1f9822107..ccc664b5b 100644
--- a/db/migrate/20131005100610_add_repositories_created_on.rb
+++ b/db/migrate/20131005100610_add_repositories_created_on.rb
@@ -1,4 +1,4 @@
-class AddRepositoriesCreatedOn < ActiveRecord::Migration
+class AddRepositoriesCreatedOn < ActiveRecord::Migration[4.2]
def up
add_column :repositories, :created_on, :timestamp
end
diff --git a/db/migrate/20131124175346_add_custom_fields_format_store.rb b/db/migrate/20131124175346_add_custom_fields_format_store.rb
index 47c7b313a..fc9cb4d66 100644
--- a/db/migrate/20131124175346_add_custom_fields_format_store.rb
+++ b/db/migrate/20131124175346_add_custom_fields_format_store.rb
@@ -1,4 +1,4 @@
-class AddCustomFieldsFormatStore < ActiveRecord::Migration
+class AddCustomFieldsFormatStore < ActiveRecord::Migration[4.2]
def up
add_column :custom_fields, :format_store, :text
end
diff --git a/db/migrate/20131210180802_add_custom_fields_description.rb b/db/migrate/20131210180802_add_custom_fields_description.rb
index 8a5d9809d..736b2cf17 100644
--- a/db/migrate/20131210180802_add_custom_fields_description.rb
+++ b/db/migrate/20131210180802_add_custom_fields_description.rb
@@ -1,4 +1,4 @@
-class AddCustomFieldsDescription < ActiveRecord::Migration
+class AddCustomFieldsDescription < ActiveRecord::Migration[4.2]
def up
add_column :custom_fields, :description, :text
end
diff --git a/db/migrate/20131214094309_remove_custom_fields_min_max_length_default_values.rb b/db/migrate/20131214094309_remove_custom_fields_min_max_length_default_values.rb
index d7111c12d..7a37d3c8d 100644
--- a/db/migrate/20131214094309_remove_custom_fields_min_max_length_default_values.rb
+++ b/db/migrate/20131214094309_remove_custom_fields_min_max_length_default_values.rb
@@ -1,4 +1,4 @@
-class RemoveCustomFieldsMinMaxLengthDefaultValues < ActiveRecord::Migration
+class RemoveCustomFieldsMinMaxLengthDefaultValues < ActiveRecord::Migration[4.2]
def up
change_column :custom_fields, :min_length, :int, :default => nil, :null => true
change_column :custom_fields, :max_length, :int, :default => nil, :null => true
diff --git a/db/migrate/20131215104612_store_relation_type_in_journal_details.rb b/db/migrate/20131215104612_store_relation_type_in_journal_details.rb
index 3fa6b1f11..c1990e67d 100644
--- a/db/migrate/20131215104612_store_relation_type_in_journal_details.rb
+++ b/db/migrate/20131215104612_store_relation_type_in_journal_details.rb
@@ -1,4 +1,4 @@
-class StoreRelationTypeInJournalDetails < ActiveRecord::Migration
+class StoreRelationTypeInJournalDetails < ActiveRecord::Migration[4.2]
MAPPING = {
"label_relates_to" => "relates",
diff --git a/db/migrate/20131218183023_delete_orphan_time_entries_custom_values.rb b/db/migrate/20131218183023_delete_orphan_time_entries_custom_values.rb
index f4e593559..e9d902d2f 100644
--- a/db/migrate/20131218183023_delete_orphan_time_entries_custom_values.rb
+++ b/db/migrate/20131218183023_delete_orphan_time_entries_custom_values.rb
@@ -1,4 +1,4 @@
-class DeleteOrphanTimeEntriesCustomValues < ActiveRecord::Migration
+class DeleteOrphanTimeEntriesCustomValues < ActiveRecord::Migration[4.2]
def up
CustomValue.where("customized_type = ? AND NOT EXISTS (SELECT 1 FROM #{TimeEntry.table_name} t WHERE t.id = customized_id)", "TimeEntry").delete_all
end
diff --git a/db/migrate/20140228130325_change_changesets_comments_limit.rb b/db/migrate/20140228130325_change_changesets_comments_limit.rb
index dccc23757..2cff73120 100644
--- a/db/migrate/20140228130325_change_changesets_comments_limit.rb
+++ b/db/migrate/20140228130325_change_changesets_comments_limit.rb
@@ -1,4 +1,4 @@
-class ChangeChangesetsCommentsLimit < ActiveRecord::Migration
+class ChangeChangesetsCommentsLimit < ActiveRecord::Migration[4.2]
def up
if ActiveRecord::Base.connection.adapter_name =~ /mysql/i
max_size = 16.megabytes
diff --git a/db/migrate/20140903143914_add_password_changed_at_to_user.rb b/db/migrate/20140903143914_add_password_changed_at_to_user.rb
index 508b9d809..80ebd9e3e 100644
--- a/db/migrate/20140903143914_add_password_changed_at_to_user.rb
+++ b/db/migrate/20140903143914_add_password_changed_at_to_user.rb
@@ -1,5 +1,5 @@
-class AddPasswordChangedAtToUser < ActiveRecord::Migration
- def change
- add_column :users, :passwd_changed_on, :datetime
- end
-end
+class AddPasswordChangedAtToUser < ActiveRecord::Migration[4.2]
+ def change
+ add_column :users, :passwd_changed_on, :datetime
+ end
+end
diff --git a/db/migrate/20140920094058_insert_builtin_groups.rb b/db/migrate/20140920094058_insert_builtin_groups.rb
index ec505af2f..f58d77fba 100644
--- a/db/migrate/20140920094058_insert_builtin_groups.rb
+++ b/db/migrate/20140920094058_insert_builtin_groups.rb
@@ -1,4 +1,4 @@
-class InsertBuiltinGroups < ActiveRecord::Migration
+class InsertBuiltinGroups < ActiveRecord::Migration[4.2]
def up
Group.reset_column_information
diff --git a/db/migrate/20141029181752_add_trackers_default_status_id.rb b/db/migrate/20141029181752_add_trackers_default_status_id.rb
index c0315df70..74716ea63 100644
--- a/db/migrate/20141029181752_add_trackers_default_status_id.rb
+++ b/db/migrate/20141029181752_add_trackers_default_status_id.rb
@@ -1,4 +1,4 @@
-class AddTrackersDefaultStatusId < ActiveRecord::Migration
+class AddTrackersDefaultStatusId < ActiveRecord::Migration[4.2]
def up
add_column :trackers, :default_status_id, :integer
diff --git a/db/migrate/20141029181824_remove_issue_statuses_is_default.rb b/db/migrate/20141029181824_remove_issue_statuses_is_default.rb
index c5c813d62..09808e31c 100644
--- a/db/migrate/20141029181824_remove_issue_statuses_is_default.rb
+++ b/db/migrate/20141029181824_remove_issue_statuses_is_default.rb
@@ -1,4 +1,4 @@
-class RemoveIssueStatusesIsDefault < ActiveRecord::Migration
+class RemoveIssueStatusesIsDefault < ActiveRecord::Migration[4.2]
def up
remove_column :issue_statuses, :is_default
end
diff --git a/db/migrate/20141109112308_add_roles_users_visibility.rb b/db/migrate/20141109112308_add_roles_users_visibility.rb
index 05c4b6cff..ef9dabb2b 100644
--- a/db/migrate/20141109112308_add_roles_users_visibility.rb
+++ b/db/migrate/20141109112308_add_roles_users_visibility.rb
@@ -1,4 +1,4 @@
-class AddRolesUsersVisibility < ActiveRecord::Migration
+class AddRolesUsersVisibility < ActiveRecord::Migration[4.2]
def self.up
add_column :roles, :users_visibility, :string, :limit => 30, :default => 'all', :null => false
end
diff --git a/db/migrate/20141122124142_add_wiki_redirects_redirects_to_wiki_id.rb b/db/migrate/20141122124142_add_wiki_redirects_redirects_to_wiki_id.rb
index 6dfbd0e14..fee149968 100644
--- a/db/migrate/20141122124142_add_wiki_redirects_redirects_to_wiki_id.rb
+++ b/db/migrate/20141122124142_add_wiki_redirects_redirects_to_wiki_id.rb
@@ -1,4 +1,4 @@
-class AddWikiRedirectsRedirectsToWikiId < ActiveRecord::Migration
+class AddWikiRedirectsRedirectsToWikiId < ActiveRecord::Migration[4.2]
def self.up
add_column :wiki_redirects, :redirects_to_wiki_id, :integer
WikiRedirect.update_all "redirects_to_wiki_id = wiki_id"
diff --git a/db/migrate/20150113194759_create_email_addresses.rb b/db/migrate/20150113194759_create_email_addresses.rb
index a0babce62..22ad19e94 100644
--- a/db/migrate/20150113194759_create_email_addresses.rb
+++ b/db/migrate/20150113194759_create_email_addresses.rb
@@ -1,4 +1,4 @@
-class CreateEmailAddresses < ActiveRecord::Migration
+class CreateEmailAddresses < ActiveRecord::Migration[4.2]
def change
create_table :email_addresses do |t|
t.column :user_id, :integer, :null => false
diff --git a/db/migrate/20150113211532_populate_email_addresses.rb b/db/migrate/20150113211532_populate_email_addresses.rb
index 80a5fb016..7e4a5509d 100644
--- a/db/migrate/20150113211532_populate_email_addresses.rb
+++ b/db/migrate/20150113211532_populate_email_addresses.rb
@@ -1,4 +1,4 @@
-class PopulateEmailAddresses < ActiveRecord::Migration
+class PopulateEmailAddresses < ActiveRecord::Migration[4.2]
def self.up
t = EmailAddress.connection.quoted_true
n = EmailAddress.connection.quoted_date(Time.now)
diff --git a/db/migrate/20150113213922_remove_users_mail.rb b/db/migrate/20150113213922_remove_users_mail.rb
index 81bbcf1b7..2942c4136 100644
--- a/db/migrate/20150113213922_remove_users_mail.rb
+++ b/db/migrate/20150113213922_remove_users_mail.rb
@@ -1,4 +1,4 @@
-class RemoveUsersMail < ActiveRecord::Migration
+class RemoveUsersMail < ActiveRecord::Migration[4.2]
def self.up
remove_column :users, :mail
end
diff --git a/db/migrate/20150113213955_add_email_addresses_user_id_index.rb b/db/migrate/20150113213955_add_email_addresses_user_id_index.rb
index b7fb90c97..b57b362fa 100644
--- a/db/migrate/20150113213955_add_email_addresses_user_id_index.rb
+++ b/db/migrate/20150113213955_add_email_addresses_user_id_index.rb
@@ -1,4 +1,4 @@
-class AddEmailAddressesUserIdIndex < ActiveRecord::Migration
+class AddEmailAddressesUserIdIndex < ActiveRecord::Migration[4.2]
def up
add_index :email_addresses, :user_id
end
diff --git a/db/migrate/20150208105930_replace_move_issues_permission.rb b/db/migrate/20150208105930_replace_move_issues_permission.rb
index 18578f7da..690bba23c 100644
--- a/db/migrate/20150208105930_replace_move_issues_permission.rb
+++ b/db/migrate/20150208105930_replace_move_issues_permission.rb
@@ -1,4 +1,4 @@
-class ReplaceMoveIssuesPermission < ActiveRecord::Migration
+class ReplaceMoveIssuesPermission < ActiveRecord::Migration[4.2]
def self.up
Role.all.each do |role|
if role.has_permission?(:edit_issues) && !role.has_permission?(:move_issues)
diff --git a/db/migrate/20150510083747_change_documents_title_limit.rb b/db/migrate/20150510083747_change_documents_title_limit.rb
index 6e3090334..ebb2767c7 100644
--- a/db/migrate/20150510083747_change_documents_title_limit.rb
+++ b/db/migrate/20150510083747_change_documents_title_limit.rb
@@ -1,4 +1,4 @@
-class ChangeDocumentsTitleLimit < ActiveRecord::Migration
+class ChangeDocumentsTitleLimit < ActiveRecord::Migration[4.2]
def self.up
change_column :documents, :title, :string, :limit => nil, :default => '', :null => false
end
diff --git a/db/migrate/20150525103953_clear_estimated_hours_on_parent_issues.rb b/db/migrate/20150525103953_clear_estimated_hours_on_parent_issues.rb
index c00ada096..4dfc38d2f 100644
--- a/db/migrate/20150525103953_clear_estimated_hours_on_parent_issues.rb
+++ b/db/migrate/20150525103953_clear_estimated_hours_on_parent_issues.rb
@@ -1,4 +1,4 @@
-class ClearEstimatedHoursOnParentIssues < ActiveRecord::Migration
+class ClearEstimatedHoursOnParentIssues < ActiveRecord::Migration[4.2]
def self.up
# Clears estimated hours on parent issues
Issue.where("rgt > lft + 1 AND estimated_hours > 0").update_all :estimated_hours => nil
diff --git a/db/migrate/20150526183158_add_roles_time_entries_visibility.rb b/db/migrate/20150526183158_add_roles_time_entries_visibility.rb
index 991a14f02..968adc6eb 100644
--- a/db/migrate/20150526183158_add_roles_time_entries_visibility.rb
+++ b/db/migrate/20150526183158_add_roles_time_entries_visibility.rb
@@ -1,4 +1,4 @@
-class AddRolesTimeEntriesVisibility < ActiveRecord::Migration
+class AddRolesTimeEntriesVisibility < ActiveRecord::Migration[4.2]
def self.up
add_column :roles, :time_entries_visibility, :string, :limit => 30, :default => 'all', :null => false
end
diff --git a/db/migrate/20150528084820_add_roles_all_roles_managed.rb b/db/migrate/20150528084820_add_roles_all_roles_managed.rb
index c4e2b9b17..08c8ddce3 100644
--- a/db/migrate/20150528084820_add_roles_all_roles_managed.rb
+++ b/db/migrate/20150528084820_add_roles_all_roles_managed.rb
@@ -1,4 +1,4 @@
-class AddRolesAllRolesManaged < ActiveRecord::Migration
+class AddRolesAllRolesManaged < ActiveRecord::Migration[4.2]
def change
add_column :roles, :all_roles_managed, :boolean, :default => true, :null => false
end
diff --git a/db/migrate/20150528092912_create_roles_managed_roles.rb b/db/migrate/20150528092912_create_roles_managed_roles.rb
index 94e5ee2d8..707fca675 100644
--- a/db/migrate/20150528092912_create_roles_managed_roles.rb
+++ b/db/migrate/20150528092912_create_roles_managed_roles.rb
@@ -1,4 +1,4 @@
-class CreateRolesManagedRoles < ActiveRecord::Migration
+class CreateRolesManagedRoles < ActiveRecord::Migration[4.2]
def change
create_table :roles_managed_roles, :id => false do |t|
t.integer :role_id, :null => false
diff --git a/db/migrate/20150528093249_add_unique_index_on_roles_managed_roles.rb b/db/migrate/20150528093249_add_unique_index_on_roles_managed_roles.rb
index 74dc64b38..c20873629 100644
--- a/db/migrate/20150528093249_add_unique_index_on_roles_managed_roles.rb
+++ b/db/migrate/20150528093249_add_unique_index_on_roles_managed_roles.rb
@@ -1,4 +1,4 @@
-class AddUniqueIndexOnRolesManagedRoles < ActiveRecord::Migration
+class AddUniqueIndexOnRolesManagedRoles < ActiveRecord::Migration[4.2]
def change
add_index :roles_managed_roles, [:role_id, :managed_role_id], :unique => true
end
diff --git a/db/migrate/20150725112753_insert_allowed_statuses_for_new_issues.rb b/db/migrate/20150725112753_insert_allowed_statuses_for_new_issues.rb
index dec3bdda1..f86d54f47 100644
--- a/db/migrate/20150725112753_insert_allowed_statuses_for_new_issues.rb
+++ b/db/migrate/20150725112753_insert_allowed_statuses_for_new_issues.rb
@@ -1,4 +1,4 @@
-class InsertAllowedStatusesForNewIssues < ActiveRecord::Migration
+class InsertAllowedStatusesForNewIssues < ActiveRecord::Migration[4.2]
def self.up
# Adds the default status for all trackers and roles
sql = "INSERT INTO #{WorkflowTransition.table_name} (tracker_id, old_status_id, new_status_id, role_id, type)" +
diff --git a/db/migrate/20150730122707_create_imports.rb b/db/migrate/20150730122707_create_imports.rb
index b6bedfc96..0a4109edb 100644
--- a/db/migrate/20150730122707_create_imports.rb
+++ b/db/migrate/20150730122707_create_imports.rb
@@ -1,4 +1,4 @@
-class CreateImports < ActiveRecord::Migration
+class CreateImports < ActiveRecord::Migration[4.2]
def change
create_table :imports do |t|
t.string :type
diff --git a/db/migrate/20150730122735_create_import_items.rb b/db/migrate/20150730122735_create_import_items.rb
index 7e9cfb7d6..2639805dd 100644
--- a/db/migrate/20150730122735_create_import_items.rb
+++ b/db/migrate/20150730122735_create_import_items.rb
@@ -1,4 +1,4 @@
-class CreateImportItems < ActiveRecord::Migration
+class CreateImportItems < ActiveRecord::Migration[4.2]
def change
create_table :import_items do |t|
t.integer :import_id, :null => false
diff --git a/db/migrate/20150921204850_change_time_entries_comments_limit_to_1024.rb b/db/migrate/20150921204850_change_time_entries_comments_limit_to_1024.rb
index 8366e8f10..f529a99fc 100644
--- a/db/migrate/20150921204850_change_time_entries_comments_limit_to_1024.rb
+++ b/db/migrate/20150921204850_change_time_entries_comments_limit_to_1024.rb
@@ -1,4 +1,4 @@
-class ChangeTimeEntriesCommentsLimitTo1024 < ActiveRecord::Migration
+class ChangeTimeEntriesCommentsLimitTo1024 < ActiveRecord::Migration[4.2]
def self.up
change_column :time_entries, :comments, :string, :limit => 1024
end
diff --git a/db/migrate/20150921210243_change_wiki_contents_comments_limit_to_1024.rb b/db/migrate/20150921210243_change_wiki_contents_comments_limit_to_1024.rb
index 5a35b03a1..9f85a7c61 100644
--- a/db/migrate/20150921210243_change_wiki_contents_comments_limit_to_1024.rb
+++ b/db/migrate/20150921210243_change_wiki_contents_comments_limit_to_1024.rb
@@ -1,4 +1,4 @@
-class ChangeWikiContentsCommentsLimitTo1024 < ActiveRecord::Migration
+class ChangeWikiContentsCommentsLimitTo1024 < ActiveRecord::Migration[4.2]
def self.up
change_column :wiki_content_versions, :comments, :string, :limit => 1024, :default => ''
change_column :wiki_contents, :comments, :string, :limit => 1024, :default => ''
diff --git a/db/migrate/20151020182334_change_attachments_filesize_limit_to_8.rb b/db/migrate/20151020182334_change_attachments_filesize_limit_to_8.rb
index a58e57183..508e3ad39 100644
--- a/db/migrate/20151020182334_change_attachments_filesize_limit_to_8.rb
+++ b/db/migrate/20151020182334_change_attachments_filesize_limit_to_8.rb
@@ -1,4 +1,4 @@
-class ChangeAttachmentsFilesizeLimitTo8 < ActiveRecord::Migration
+class ChangeAttachmentsFilesizeLimitTo8 < ActiveRecord::Migration[4.2]
def self.up
change_column :attachments, :filesize, :integer, :limit => 8, :default => 0, :null => false
end
diff --git a/db/migrate/20151020182731_fix_comma_in_user_format_setting_value.rb b/db/migrate/20151020182731_fix_comma_in_user_format_setting_value.rb
index 751ff21f2..9c185b0cd 100644
--- a/db/migrate/20151020182731_fix_comma_in_user_format_setting_value.rb
+++ b/db/migrate/20151020182731_fix_comma_in_user_format_setting_value.rb
@@ -1,4 +1,4 @@
-class FixCommaInUserFormatSettingValue < ActiveRecord::Migration
+class FixCommaInUserFormatSettingValue < ActiveRecord::Migration[4.2]
def self.up
Setting.
where(:name => 'user_format', :value => 'lastname_coma_firstname').
diff --git a/db/migrate/20151021184614_change_issue_categories_name_limit_to_60.rb b/db/migrate/20151021184614_change_issue_categories_name_limit_to_60.rb
index b9c971edf..7d0fa8a17 100644
--- a/db/migrate/20151021184614_change_issue_categories_name_limit_to_60.rb
+++ b/db/migrate/20151021184614_change_issue_categories_name_limit_to_60.rb
@@ -1,4 +1,4 @@
-class ChangeIssueCategoriesNameLimitTo60 < ActiveRecord::Migration
+class ChangeIssueCategoriesNameLimitTo60 < ActiveRecord::Migration[4.2]
def self.up
change_column :issue_categories, :name, :string, :limit => 60, :default => "", :null => false
end
diff --git a/db/migrate/20151021185456_change_auth_sources_filter_to_text.rb b/db/migrate/20151021185456_change_auth_sources_filter_to_text.rb
index 344f9fa4a..71575631e 100644
--- a/db/migrate/20151021185456_change_auth_sources_filter_to_text.rb
+++ b/db/migrate/20151021185456_change_auth_sources_filter_to_text.rb
@@ -1,4 +1,4 @@
-class ChangeAuthSourcesFilterToText < ActiveRecord::Migration
+class ChangeAuthSourcesFilterToText < ActiveRecord::Migration[4.2]
def self.up
change_column :auth_sources, :filter, :text
end
diff --git a/db/migrate/20151021190616_change_user_preferences_hide_mail_default_to_true.rb b/db/migrate/20151021190616_change_user_preferences_hide_mail_default_to_true.rb
index fc5d268a6..bee79924c 100644
--- a/db/migrate/20151021190616_change_user_preferences_hide_mail_default_to_true.rb
+++ b/db/migrate/20151021190616_change_user_preferences_hide_mail_default_to_true.rb
@@ -1,4 +1,4 @@
-class ChangeUserPreferencesHideMailDefaultToTrue < ActiveRecord::Migration
+class ChangeUserPreferencesHideMailDefaultToTrue < ActiveRecord::Migration[4.2]
def self.up
change_column :user_preferences, :hide_mail, :boolean, :default => true
end
diff --git a/db/migrate/20151024082034_add_tokens_updated_on.rb b/db/migrate/20151024082034_add_tokens_updated_on.rb
index 0af28dc81..7b94a3a95 100644
--- a/db/migrate/20151024082034_add_tokens_updated_on.rb
+++ b/db/migrate/20151024082034_add_tokens_updated_on.rb
@@ -1,4 +1,4 @@
-class AddTokensUpdatedOn < ActiveRecord::Migration
+class AddTokensUpdatedOn < ActiveRecord::Migration[4.2]
def self.up
add_column :tokens, :updated_on, :timestamp
Token.update_all("updated_on = created_on")
diff --git a/db/migrate/20151025072118_create_custom_field_enumerations.rb b/db/migrate/20151025072118_create_custom_field_enumerations.rb
index ea2e5103f..c1b2eaec4 100644
--- a/db/migrate/20151025072118_create_custom_field_enumerations.rb
+++ b/db/migrate/20151025072118_create_custom_field_enumerations.rb
@@ -1,4 +1,4 @@
-class CreateCustomFieldEnumerations < ActiveRecord::Migration
+class CreateCustomFieldEnumerations < ActiveRecord::Migration[4.2]
def change
create_table :custom_field_enumerations do |t|
t.integer :custom_field_id, :null => false
diff --git a/db/migrate/20151031095005_add_projects_default_version_id.rb b/db/migrate/20151031095005_add_projects_default_version_id.rb
index 7d38f36cd..e62c54e89 100644
--- a/db/migrate/20151031095005_add_projects_default_version_id.rb
+++ b/db/migrate/20151031095005_add_projects_default_version_id.rb
@@ -1,4 +1,4 @@
-class AddProjectsDefaultVersionId < ActiveRecord::Migration
+class AddProjectsDefaultVersionId < ActiveRecord::Migration[4.2]
def self.up
# Don't try to add the column if redmine_default_version plugin was used
unless column_exists?(:projects, :default_version_id, :integer)
diff --git a/db/migrate/20160404080304_force_password_reset_during_setup.rb b/db/migrate/20160404080304_force_password_reset_during_setup.rb
index d80057a2c..00d3a65a5 100644
--- a/db/migrate/20160404080304_force_password_reset_during_setup.rb
+++ b/db/migrate/20160404080304_force_password_reset_during_setup.rb
@@ -1,4 +1,4 @@
-class ForcePasswordResetDuringSetup < ActiveRecord::Migration
+class ForcePasswordResetDuringSetup < ActiveRecord::Migration[4.2]
def up
User.where(login: "admin", last_login_on: nil).update_all(must_change_passwd: true)
end
diff --git a/db/migrate/20160416072926_remove_position_defaults.rb b/db/migrate/20160416072926_remove_position_defaults.rb
index ab3af1499..9ba7b3c8e 100644
--- a/db/migrate/20160416072926_remove_position_defaults.rb
+++ b/db/migrate/20160416072926_remove_position_defaults.rb
@@ -1,4 +1,4 @@
-class RemovePositionDefaults < ActiveRecord::Migration
+class RemovePositionDefaults < ActiveRecord::Migration[4.2]
def up
[Board, CustomField, Enumeration, IssueStatus, Role, Tracker].each do |klass|
change_column klass.table_name, :position, :integer, :default => nil
diff --git a/db/migrate/20160529063352_add_roles_settings.rb b/db/migrate/20160529063352_add_roles_settings.rb
index a4d18fcbc..84f2bf37d 100644
--- a/db/migrate/20160529063352_add_roles_settings.rb
+++ b/db/migrate/20160529063352_add_roles_settings.rb
@@ -1,4 +1,4 @@
-class AddRolesSettings < ActiveRecord::Migration
+class AddRolesSettings < ActiveRecord::Migration[4.2]
def change
add_column :roles, :settings, :text
end
diff --git a/db/migrate/20161001122012_add_tracker_id_index_to_workflows.rb b/db/migrate/20161001122012_add_tracker_id_index_to_workflows.rb
index 10c4dd97b..60c62a6f8 100644
--- a/db/migrate/20161001122012_add_tracker_id_index_to_workflows.rb
+++ b/db/migrate/20161001122012_add_tracker_id_index_to_workflows.rb
@@ -1,4 +1,4 @@
-class AddTrackerIdIndexToWorkflows < ActiveRecord::Migration
+class AddTrackerIdIndexToWorkflows < ActiveRecord::Migration[4.2]
def self.up
add_index :workflows, :tracker_id
end
diff --git a/db/migrate/20161002133421_add_index_on_member_roles_inherited_from.rb b/db/migrate/20161002133421_add_index_on_member_roles_inherited_from.rb
index 2a06a9e6c..f806a31fd 100644
--- a/db/migrate/20161002133421_add_index_on_member_roles_inherited_from.rb
+++ b/db/migrate/20161002133421_add_index_on_member_roles_inherited_from.rb
@@ -1,4 +1,4 @@
-class AddIndexOnMemberRolesInheritedFrom < ActiveRecord::Migration
+class AddIndexOnMemberRolesInheritedFrom < ActiveRecord::Migration[4.2]
def change
add_index :member_roles, :inherited_from
end
diff --git a/db/migrate/20161010081301_change_issues_description_limit.rb b/db/migrate/20161010081301_change_issues_description_limit.rb
index 0f20466a1..93fcc53ff 100644
--- a/db/migrate/20161010081301_change_issues_description_limit.rb
+++ b/db/migrate/20161010081301_change_issues_description_limit.rb
@@ -1,4 +1,4 @@
-class ChangeIssuesDescriptionLimit < ActiveRecord::Migration
+class ChangeIssuesDescriptionLimit < ActiveRecord::Migration[4.2]
def up
if ActiveRecord::Base.connection.adapter_name =~ /mysql/i
max_size = 16.megabytes
diff --git a/db/migrate/20161010081528_change_journal_details_value_limit.rb b/db/migrate/20161010081528_change_journal_details_value_limit.rb
index 2314dd535..d83fbacd6 100644
--- a/db/migrate/20161010081528_change_journal_details_value_limit.rb
+++ b/db/migrate/20161010081528_change_journal_details_value_limit.rb
@@ -1,4 +1,4 @@
-class ChangeJournalDetailsValueLimit < ActiveRecord::Migration
+class ChangeJournalDetailsValueLimit < ActiveRecord::Migration[4.2]
def up
if ActiveRecord::Base.connection.adapter_name =~ /mysql/i
max_size = 16.megabytes
diff --git a/db/migrate/20161010081600_change_journals_notes_limit.rb b/db/migrate/20161010081600_change_journals_notes_limit.rb
index 8a2ba9be6..34197bc47 100644
--- a/db/migrate/20161010081600_change_journals_notes_limit.rb
+++ b/db/migrate/20161010081600_change_journals_notes_limit.rb
@@ -1,4 +1,4 @@
-class ChangeJournalsNotesLimit < ActiveRecord::Migration
+class ChangeJournalsNotesLimit < ActiveRecord::Migration[4.2]
def up
if ActiveRecord::Base.connection.adapter_name =~ /mysql/i
max_size = 16.megabytes
diff --git a/db/migrate/20161126094932_add_index_on_changesets_issues_issue_id.rb b/db/migrate/20161126094932_add_index_on_changesets_issues_issue_id.rb
index dae77256c..1099e4ebc 100644
--- a/db/migrate/20161126094932_add_index_on_changesets_issues_issue_id.rb
+++ b/db/migrate/20161126094932_add_index_on_changesets_issues_issue_id.rb
@@ -1,5 +1,5 @@
-class AddIndexOnChangesetsIssuesIssueId < ActiveRecord::Migration
- def change
- add_index :changesets_issues, :issue_id
- end
-end
+class AddIndexOnChangesetsIssuesIssueId < ActiveRecord::Migration[4.2]
+ def change
+ add_index :changesets_issues, :issue_id
+ end
+end
diff --git a/db/migrate/20161220091118_add_index_on_issues_parent_id.rb b/db/migrate/20161220091118_add_index_on_issues_parent_id.rb
index 1cc94b098..07592a9d8 100644
--- a/db/migrate/20161220091118_add_index_on_issues_parent_id.rb
+++ b/db/migrate/20161220091118_add_index_on_issues_parent_id.rb
@@ -1,4 +1,4 @@
-class AddIndexOnIssuesParentId < ActiveRecord::Migration
+class AddIndexOnIssuesParentId < ActiveRecord::Migration[4.2]
def change
add_index :issues, :parent_id
end
diff --git a/db/migrate/20170207050700_add_index_on_disk_filename_to_attachments.rb b/db/migrate/20170207050700_add_index_on_disk_filename_to_attachments.rb
index 6f41a9c4b..3f2eaee8e 100644
--- a/db/migrate/20170207050700_add_index_on_disk_filename_to_attachments.rb
+++ b/db/migrate/20170207050700_add_index_on_disk_filename_to_attachments.rb
@@ -1,4 +1,4 @@
-class AddIndexOnDiskFilenameToAttachments < ActiveRecord::Migration
+class AddIndexOnDiskFilenameToAttachments < ActiveRecord::Migration[4.2]
def change
add_index :attachments, :disk_filename
end
diff --git a/db/migrate/20170302015225_change_attachments_digest_limit_to_64.rb b/db/migrate/20170302015225_change_attachments_digest_limit_to_64.rb
index df710e82c..620deb251 100644
--- a/db/migrate/20170302015225_change_attachments_digest_limit_to_64.rb
+++ b/db/migrate/20170302015225_change_attachments_digest_limit_to_64.rb
@@ -1,4 +1,4 @@
-class ChangeAttachmentsDigestLimitTo64 < ActiveRecord::Migration
+class ChangeAttachmentsDigestLimitTo64 < ActiveRecord::Migration[4.2]
def up
change_column :attachments, :digest, :string, limit: 64
end
diff --git a/db/migrate/20170309214320_add_project_default_assigned_to_id.rb b/db/migrate/20170309214320_add_project_default_assigned_to_id.rb
index 97a4b1905..40d3282f4 100644
--- a/db/migrate/20170309214320_add_project_default_assigned_to_id.rb
+++ b/db/migrate/20170309214320_add_project_default_assigned_to_id.rb
@@ -1,4 +1,4 @@
-class AddProjectDefaultAssignedToId < ActiveRecord::Migration
+class AddProjectDefaultAssignedToId < ActiveRecord::Migration[4.2]
def up
add_column :projects, :default_assigned_to_id, :integer, :default => nil
# Try to copy existing settings from the plugin if redmine_default_assign plugin was used
diff --git a/db/migrate/20170320051650_change_repositories_extra_info_limit.rb b/db/migrate/20170320051650_change_repositories_extra_info_limit.rb
index 3b5654a6d..104111a39 100644
--- a/db/migrate/20170320051650_change_repositories_extra_info_limit.rb
+++ b/db/migrate/20170320051650_change_repositories_extra_info_limit.rb
@@ -1,4 +1,4 @@
-class ChangeRepositoriesExtraInfoLimit < ActiveRecord::Migration
+class ChangeRepositoriesExtraInfoLimit < ActiveRecord::Migration[4.2]
def up
if ActiveRecord::Base.connection.adapter_name =~ /mysql/i
max_size = 16.megabytes
diff --git a/db/migrate/20170418090031_add_view_news_to_all_existing_roles.rb b/db/migrate/20170418090031_add_view_news_to_all_existing_roles.rb
index 6f851a1f1..7c9896c98 100644
--- a/db/migrate/20170418090031_add_view_news_to_all_existing_roles.rb
+++ b/db/migrate/20170418090031_add_view_news_to_all_existing_roles.rb
@@ -1,4 +1,4 @@
-class AddViewNewsToAllExistingRoles < ActiveRecord::Migration
+class AddViewNewsToAllExistingRoles < ActiveRecord::Migration[4.2]
def up
Role.all.each { |role| role.add_permission! :view_news }
end
diff --git a/db/migrate/20170419144536_add_view_messages_to_all_existing_roles.rb b/db/migrate/20170419144536_add_view_messages_to_all_existing_roles.rb
index d010ba497..7a3ba67e3 100644
--- a/db/migrate/20170419144536_add_view_messages_to_all_existing_roles.rb
+++ b/db/migrate/20170419144536_add_view_messages_to_all_existing_roles.rb
@@ -1,4 +1,4 @@
-class AddViewMessagesToAllExistingRoles < ActiveRecord::Migration
+class AddViewMessagesToAllExistingRoles < ActiveRecord::Migration[4.2]
def up
Role.all.each { |role| role.add_permission! :view_messages }
end
diff --git a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb
index 36996c950..3cfc49169 100644
--- a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb
+++ b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb
@@ -68,6 +68,10 @@ module Redmine
end
def save_attachments(attachments, author=User.current)
+ if attachments.respond_to?(:to_unsafe_hash)
+ attachments = attachments.to_unsafe_hash
+ end
+
if attachments.is_a?(Hash)
attachments = attachments.stringify_keys
attachments = attachments.to_a.sort {|a, b|
@@ -86,7 +90,7 @@ module Redmine
if attachments.is_a?(Array)
@failed_attachment_count = 0
attachments.each do |attachment|
- next unless attachment.is_a?(Hash)
+ next unless attachment.present?
a = nil
if file = attachment['file']
a = Attachment.create(:file => file, :author => author)
diff --git a/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb b/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb
index 2bddd64b7..5c88adb57 100644
--- a/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb
+++ b/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb
@@ -17,7 +17,6 @@ module Redmine
joins(:watchers).
where("#{Watcher.table_name}.user_id = ?", user_id)
}
- attr_protected :watcher_ids, :watcher_user_ids
end
send :include, Redmine::Acts::Watchable::InstanceMethods
end
diff --git a/lib/redmine/acts/positioned.rb b/lib/redmine/acts/positioned.rb
index 21cc14a67..00f8332b8 100644
--- a/lib/redmine/acts/positioned.rb
+++ b/lib/redmine/acts/positioned.rb
@@ -54,7 +54,9 @@ module Redmine
end
def position_scope_was
- build_position_scope {|c| send("#{c}_was")}
+ # this can be called in after_update or after_destroy callbacks
+ # with different methods in Rails 5 for retrieving the previous value
+ build_position_scope {|c| send(destroyed? ? "#{c}_was" : "#{c}_before_last_save")}
end
def build_position_scope
@@ -75,8 +77,8 @@ module Redmine
if !new_record? && position_scope_changed?
remove_position
insert_position
- elsif position_changed?
- if position_was.nil?
+ elsif saved_change_to_position?
+ if position_before_last_save.nil?
insert_position
else
shift_positions
@@ -89,16 +91,19 @@ module Redmine
end
def remove_position
- position_scope_was.where("position >= ? AND id <> ?", position_was, id).update_all("position = position - 1")
+ # this can be called in after_update or after_destroy callbacks
+ # with different methods in Rails 5 for retrieving the previous value
+ previous = destroyed? ? position_was : position_before_last_save
+ position_scope_was.where("position >= ? AND id <> ?", previous, id).update_all("position = position - 1")
end
def position_scope_changed?
- (changed & self.class.positioned_options[:scope].map(&:to_s)).any?
+ (saved_changes.keys & self.class.positioned_options[:scope].map(&:to_s)).any?
end
def shift_positions
- offset = position_was <=> position
- min, max = [position, position_was].sort
+ offset = position_before_last_save <=> position
+ min, max = [position, position_before_last_save].sort
r = position_scope.where("id <> ? AND position BETWEEN ? AND ?", id, min, max).update_all("position = position + #{offset}")
if r != max - min
reset_positions_in_list
diff --git a/lib/redmine/field_format.rb b/lib/redmine/field_format.rb
index fade7c257..b59760674 100644
--- a/lib/redmine/field_format.rb
+++ b/lib/redmine/field_format.rb
@@ -972,7 +972,7 @@ module Redmine
end
def after_save_custom_value(custom_field, custom_value)
- if custom_value.value_changed?
+ if custom_value.saved_change_to_value?
if custom_value.value.present?
attachment = Attachment.where(:id => custom_value.value.to_s).first
if attachment
@@ -980,8 +980,8 @@ module Redmine
attachment.save!
end
end
- if custom_value.value_was.present?
- attachment = Attachment.where(:id => custom_value.value_was.to_s).first
+ if custom_value.value_before_last_save.present?
+ attachment = Attachment.where(:id => custom_value.value_before_last_save.to_s).first
if attachment
attachment.destroy
end
diff --git a/lib/redmine/safe_attributes.rb b/lib/redmine/safe_attributes.rb
index 0bde0f970..a2711cc4b 100644
--- a/lib/redmine/safe_attributes.rb
+++ b/lib/redmine/safe_attributes.rb
@@ -80,6 +80,10 @@ module Redmine
# Sets attributes from attrs that are safe
# attrs is a Hash with string keys
def safe_attributes=(attrs, user=User.current)
+ if attrs.respond_to?(:to_unsafe_hash)
+ attrs = attrs.to_unsafe_hash
+ end
+
return unless attrs.is_a?(Hash)
self.attributes = delete_unsafe_attributes(attrs, user)
end
diff --git a/lib/redmine/sudo_mode.rb b/lib/redmine/sudo_mode.rb
index eddbc04ce..fa491b759 100644
--- a/lib/redmine/sudo_mode.rb
+++ b/lib/redmine/sudo_mode.rb
@@ -31,7 +31,7 @@ module Redmine
#
# taken from https://github.com/brianhempel/hash_to_hidden_fields
def hash_to_hidden_fields(hash)
- cleaned_hash = hash.reject { |k, v| v.nil? }
+ cleaned_hash = hash.to_unsafe_h.reject { |k, v| v.nil? }
pairs = cleaned_hash.to_query.split(Rack::Utils::DEFAULT_SEP)
tags = pairs.map do |pair|
key, value = pair.split('=', 2).map { |str| Rack::Utils.unescape(str) }
diff --git a/lib/tasks/redmine.rake b/lib/tasks/redmine.rake
index fa4b02b33..30d5c4c64 100644
--- a/lib/tasks/redmine.rake
+++ b/lib/tasks/redmine.rake
@@ -160,31 +160,27 @@ DESC
namespace :test do
desc 'Runs the plugins unit tests.'
- Rake::TestTask.new :units => "db:test:prepare" do |t|
- t.libs << "test"
- t.verbose = true
- t.pattern = "plugins/#{ENV['NAME'] || '*'}/test/unit/**/*_test.rb"
+ task :units => "db:test:prepare" do |t|
+ $: << "test"
+ Minitest.rake_run ["plugins/#{ENV['NAME'] || '*'}/test/unit/**/*_test.rb"]
end
desc 'Runs the plugins functional tests.'
- Rake::TestTask.new :functionals => "db:test:prepare" do |t|
- t.libs << "test"
- t.verbose = true
- t.pattern = "plugins/#{ENV['NAME'] || '*'}/test/functional/**/*_test.rb"
+ task :functionals => "db:test:prepare" do |t|
+ $: << "test"
+ Minitest.rake_run ["plugins/#{ENV['NAME'] || '*'}/test/functional/**/*_test.rb"]
end
desc 'Runs the plugins integration tests.'
- Rake::TestTask.new :integration => "db:test:prepare" do |t|
- t.libs << "test"
- t.verbose = true
- t.pattern = "plugins/#{ENV['NAME'] || '*'}/test/integration/**/*_test.rb"
+ task :integration => "db:test:prepare" do |t|
+ $: << "test"
+ Minitest.rake_run ["plugins/#{ENV['NAME'] || '*'}/test/integration/**/*_test.rb"]
end
desc 'Runs the plugins ui tests.'
- Rake::TestTask.new :ui => "db:test:prepare" do |t|
- t.libs << "test"
- t.verbose = true
- t.pattern = "plugins/#{ENV['NAME'] || '*'}/test/ui/**/*_test.rb"
+ task :ui => "db:test:prepare" do |t|
+ $: << "test"
+ Minitest.rake_run ["plugins/#{ENV['NAME'] || '*'}/test/ui/**/*_test.rb"]
end
end
end
diff --git a/lib/tasks/testing.rake b/lib/tasks/testing.rake
index 831f4d316..47364c82c 100644
--- a/lib/tasks/testing.rake
+++ b/lib/tasks/testing.rake
@@ -79,34 +79,28 @@ namespace :test do
end
end
- Rake::TestTask.new(:units => "db:test:prepare") do |t|
- t.libs << "test"
- t.verbose = true
- t.warning = false
- t.test_files = FileList['test/unit/repository*_test.rb'] + FileList['test/unit/lib/redmine/scm/**/*_test.rb']
+ task(:units => "db:test:prepare") do |t|
+ $: << "test"
+ Minitest.rake_run FileList['test/unit/repository*_test.rb'] + FileList['test/unit/lib/redmine/scm/**/*_test.rb']
end
Rake::Task['test:scm:units'].comment = "Run the scm unit tests"
- Rake::TestTask.new(:functionals => "db:test:prepare") do |t|
- t.libs << "test"
- t.verbose = true
- t.warning = false
- t.test_files = FileList['test/functional/repositories*_test.rb']
+ task(:functionals => "db:test:prepare") do |t|
+ $: << "test"
+ Minitest.rake_run FileList['test/functional/repositories*_test.rb']
end
Rake::Task['test:scm:functionals'].comment = "Run the scm functional tests"
end
- Rake::TestTask.new(:routing) do |t|
- t.libs << "test"
- t.verbose = true
- t.test_files = FileList['test/integration/routing/*_test.rb'] + FileList['test/integration/api_test/*_routing_test.rb']
+ task(:routing) do |t|
+ $: << "test"
+ Minitest.rake_run FileList['test/integration/routing/*_test.rb'] + FileList['test/integration/api_test/*_routing_test.rb']
end
Rake::Task['test:routing'].comment = "Run the routing tests"
- Rake::TestTask.new(:ui => "db:test:prepare") do |t|
- t.libs << "test"
- t.verbose = true
- t.test_files = FileList['test/ui/**/*_test_ui.rb']
+ task(:ui => "db:test:prepare") do |t|
+ $: << "test"
+ Minitest.rake_run FileList['test/ui/**/*_test_ui.rb']
end
Rake::Task['test:ui'].comment = "Run the UI tests with Capybara (PhantomJS listening on port 4444 is required)"
end
diff --git a/public/javascripts/jquery-1.11.1-ui-1.11.0-ujs-3.1.4.js b/public/javascripts/jquery-1.11.1-ui-1.11.0-ujs-5.1.2.js
index 7bfbf214f..08dc3aaf4 100644
--- a/public/javascripts/jquery-1.11.1-ui-1.11.0-ujs-3.1.4.js
+++ b/public/javascripts/jquery-1.11.1-ui-1.11.0-ujs-5.1.2.js
@@ -17,5 +17,5 @@ f&&e.effects.save(i,l),i.from={height:s.height*a.from.y,width:s.width*a.from.x,o
return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-e(document).scrollTop()<o.scrollSensitivity?r=e(document).scrollTop(e(document).scrollTop()-o.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<o.scrollSensitivity&&(r=e(document).scrollTop(e(document).scrollTop()+o.scrollSpeed)),t.pageX-e(document).scrollLeft()<o.scrollSensitivity?r=e(document).scrollLeft(e(document).scrollLeft()-o.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<o.scrollSensitivity&&(r=e(document).scrollLeft(e(document).scrollLeft()+o.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!e.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&s.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!s.length&&t.key&&s.push(t.key+"="),s.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},i.each(function(){s.push(e(t.item||this).attr(t.attribute||"id")||"")}),s},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=e.left,o=a+e.width,r=e.top,h=r+e.height,l=this.offset.click.top,u=this.offset.click.left,d="x"===this.options.axis||s+l>r&&h>s+l,c="y"===this.options.axis||t+u>a&&o>t+u,p=d&&c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:t+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(e){var t="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),s=t&&i,n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return s?this.floating?a&&"right"===a||"down"===n?2:1:n&&("down"===n?2:1):!1},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&t||"up"===s&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function i(){r.push(this)}var s,n,a,o,r=[],h=[],l=this._connectWith();if(l&&t)for(s=l.length-1;s>=0;s--)for(a=e(l[s]),n=a.length-1;n>=0;n--)o=e.data(a[n],this.widgetFullName),o&&o!==this&&!o.options.disabled&&h.push([e.isFunction(o.options.items)?o.options.items.call(o.element):e(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(h.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return e(r)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;t.length>i;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,u=this.items,d=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready)for(i=c.length-1;i>=0;i--)for(n=e(c[i]),s=n.length-1;s>=0;s--)a=e.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(d.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a));for(i=d.length-1;i>=0;i--)for(o=d[i][1],r=d[i][0],s=0,l=r.length;l>s;s++)h=e(r[s]),h.data(this.widgetName+"-item",o),u.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?e(this.options.toleranceElement,s.item):s.item,t||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var i,s=t.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=t.currentItem[0].nodeName.toLowerCase(),n=e("<"+s+">",t.document[0]).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?t.currentItem.children().each(function(){e("<td>&#160;</td>",t.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(n)}):"img"===s&&n.attr("src",t.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(e,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(s.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),s.placeholder.update(t,t.placeholder)},_contactContainers:function(t){var i,s,n,a,o,r,h,l,u,d,c=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!e.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(c&&e.contains(this.containers[i].element[0],c.element[0]))continue;c=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0);if(c)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,a=null,u=c.floating||this._isFloating(this.currentItem),o=u?"left":"top",r=u?"width":"height",d=u?"clientX":"clientY",s=this.items.length-1;s>=0;s--)e.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[o],l=!1,t[d]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(t[d]-h)&&(n=Math.abs(t[d]-h),a=this.items[s],this.direction=l?"up":"down"));if(!a&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return;a?this._rearrange(t,a,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(e("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(t=e(n.containment)[0],i=e(n.containment).offset(),s="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(t){var i,s,n=this.options,a=t.pageX,o=t.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(e,t,i,s){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(e,t){function i(e,t,i){return function(s){i._trigger(e,s,t._uiHash(t))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&n.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||n.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(n.push(function(e){this._trigger("remove",e,this._uiHash())}),n.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)t||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!t){for(this._trigger("beforeStop",e,this._uiHash()),s=0;n.length>s;s++)n[s].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!1}if(t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!t){for(s=0;n.length>s;s++)n[s].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}}),e.widget("ui.spinner",{version:"1.11.0",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},i=this.element;return e.each(["min","max","step"],function(e,s){var n=i.attr(s);void 0!==n&&n.length&&(t[s]=n)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e),void 0)},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(t){function i(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(t)!==!1&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){return e(t.currentTarget).hasClass("ui-state-active")?this._start(t)===!1?!1:(this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*e.height())&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var i=this.options,s=e.ui.keyCode;switch(t.keyCode){case s.UP:return this._repeat(null,1,t),!0;case s.DOWN:return this._repeat(null,-1,t),!0;case s.PAGE_UP:return this._repeat(null,i.page,t),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(e){return this.spinning||this._trigger("start",e)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(e,t,i){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,i)},e),this._spin(t*this.options.step,i)},_spin:function(e,t){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+e*this._increment(this.counter)),this.spinning&&this._trigger("spin",t,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(t){var i=this.options.incremental;return i?e.isFunction(i)?i(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_adjustValue:function(e){var t,i,s=this.options;return t=null!==s.min?s.min:0,i=e-t,i=Math.round(i/s.step)*s.step,e=t+i,e=parseFloat(e.toFixed(this._precision())),null!==s.max&&e>s.max?s.max:null!==s.min&&s.min>e?s.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){if("culture"===e||"numberFormat"===e){var i=this._parse(this.element.val());return this.options[e]=t,this.element.val(this._format(i)),void 0}("max"===e||"min"===e||"step"===e)&&"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)),this._super(e,t),"disabled"===e&&(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable"))},_setOptions:r(function(e){this._super(e)}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var e=this.value();return null===e?!1:e===this._adjustValue(e)},_value:function(e,t){var i;""!==e&&(i=this._parse(e),null!==i&&(t||(i=this._adjustValue(i)),e=this._format(i))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:r(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:r(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:r(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:r(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){return arguments.length?(r(this._value).call(this,e),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),e.widget("ui.tabs",{version:"1.11.0",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(t){var i,s;t=t.cloneNode(!1),i=t.href.replace(e,""),s=location.href.replace(e,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return t.hash.length>1&&i===s}}(),_create:function(){var t=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),e.isArray(i.disabled)&&(i.disabled=e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===t&&(s&&this.tabs.each(function(i,n){return e(n).attr("aria-controls")===s?(t=i,!1):void 0}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=i?!1:0)),!i&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(this.document[0].activeElement).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:s++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:n=!1,s--;break;case e.ui.keyCode.END:s=this.anchors.length-1;break;case e.ui.keyCode.HOME:s=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}t.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),t.ctrlKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){function s(){return t>n&&(t=0),0>t&&(t=n),t}for(var n=this.tabs.length-1;-1!==e.inArray(s(),this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):"disabled"===e?(this._setupDisabled(t),void 0):(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t),void 0)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]
}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(i,s){var n,a,o,r=e(s).uniqueId().attr("id"),h=e(s).closest("li"),l=h.attr("aria-controls");t._isLocal(s)?(n=s.hash,o=n.substring(1),a=t.element.find(t._sanitizeSelector(n))):(o=h.attr("aria-controls")||e({}).uniqueId()[0].id,n="#"+o,a=t.element.find(n),a.length||(a=t._createPanel(o),a.insertAfter(t.panels[i-1]||t.tablist)),a.attr("aria-live","polite")),a.length&&(t.panels=t.panels.add(a)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":o,"aria-labelledby":r}),a.attr("aria-labelledby",r)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var i,s=0;i=this.tabs[s];s++)t===!0||-1!==e.inArray(s,t)?e(i).addClass("ui-state-disabled").attr("aria-disabled","true"):e(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,s=this.element.parent();"fill"===t?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),s=t.css("position");"absolute"!==s&&"fixed"!==s&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?e():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):e(),u={oldTab:s,oldPanel:l,newTab:r?e():a,newPanel:h};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",t,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?e():a,this.xhr&&this.xhr.abort(),l.length||h.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),t),this._toggle(t,u))},_toggle:function(t,i){function s(){a.running=!1,a._trigger("activate",t,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var i,s=this._findActive(t);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;i!==!1&&(void 0===t?i=!1:(t=this._getIndex(t),i=e.isArray(i)?e.map(i,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,i){return i!==t?i:null})),this._setupDisabled(i))},disable:function(t){var i=this.options.disabled;if(i!==!0){if(void 0===t)i=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,i))return;i=e.isArray(i)?e.merge([t],i).sort():[t]}this._setupDisabled(i)}},load:function(t,i){t=this._getIndex(t);var s=this,n=this.tabs.eq(t),a=n.find(".ui-tabs-anchor"),o=this._getPanelForTab(n),r={tab:n,panel:o};this._isLocal(a[0])||(this.xhr=e.ajax(this._ajaxSettings(a,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(n.addClass("ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.success(function(e){setTimeout(function(){o.html(e),s._trigger("load",i,r)},1)}).complete(function(e,t){setTimeout(function(){"abort"===t&&s.panels.stop(!1,!0),n.removeClass("ui-tabs-loading"),o.removeAttr("aria-busy"),e===s.xhr&&delete s.xhr},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href"),beforeSend:function(t,a){return n._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:a},s))}}},_getPanelForTab:function(t){var i=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),e.widget("ui.tooltip",{version:"1.11.0",options:{content:function(){var t=e(this).attr("title")||"";return e("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_addDescribedBy:function(t,i){var s=(t.attr("aria-describedby")||"").split(/\s+/);s.push(i),t.data("ui-tooltip-id",i).attr("aria-describedby",e.trim(s.join(" ")))},_removeDescribedBy:function(t){var i=t.data("ui-tooltip-id"),s=(t.attr("aria-describedby")||"").split(/\s+/),n=e.inArray(i,s);-1!==n&&s.splice(n,1),t.removeData("ui-tooltip-id"),s=e.trim(s.join(" ")),s?t.attr("aria-describedby",s):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable(),this.liveRegion=e("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body)},_setOption:function(t,i){var s=this;return"disabled"===t?(this[i?"_disable":"_enable"](),this.options[t]=i,void 0):(this._super(t,i),"content"===t&&e.each(this.tooltips,function(e,t){s._updateContent(t)}),void 0)},_disable:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur");n.target=n.currentTarget=s[0],t.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var i=this,s=e(t?t.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&s.parents().each(function(){var t,s=e(this);s.data("ui-tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,i.close(t,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,t))},_updateContent:function(e,t){var i,s=this.options.content,n=this,a=t?t.type:null;return"string"==typeof s?this._open(t,e,s):(i=s.call(e[0],function(i){e.data("ui-tooltip-open")&&n._delay(function(){t&&(t.type=a),this._open(t,e,i)})}),i&&this._open(t,e,i),void 0)},_open:function(t,i,s){function n(e){l.of=e,a.is(":hidden")||a.position(l)}var a,o,r,h,l=e.extend({},this.options.position);if(s){if(a=this._find(i),a.length)return a.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(t&&"mouseover"===t.type?i.attr("title",""):i.removeAttr("title")),a=this._tooltip(i),this._addDescribedBy(i,a.attr("id")),a.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),s.clone?(h=s.clone(),h.removeAttr("id").find("[id]").removeAttr("id")):h=s,e("<div>").html(h).appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:n}),n(t)):a.position(e.extend({of:i},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){a.is(":visible")&&(n(l.of),clearInterval(r))},e.fx.interval)),this._trigger("open",t,{tooltip:a}),o={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var s=e.Event(t);s.currentTarget=i[0],this.close(s,!0)}}},i[0]!==this.element[0]&&(o.remove=function(){this._removeTooltip(a)}),t&&"mouseover"!==t.type||(o.mouseleave="close"),t&&"focusin"!==t.type||(o.focusout="close"),this._on(!0,i,o)}},close:function(t){var i=this,s=e(t?t.currentTarget:this.element),n=this._find(s);this.closing||(clearInterval(this.delayedShow),s.data("ui-tooltip-title")&&!s.attr("title")&&s.attr("title",s.data("ui-tooltip-title")),this._removeDescribedBy(s),n.stop(!0),this._hide(n,this.options.hide,function(){i._removeTooltip(e(this))}),s.removeData("ui-tooltip-open"),this._off(s,"mouseleave focusout keyup"),s[0]!==this.element[0]&&this._off(s,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,s){e(s.element).attr("title",s.title),delete i.parents[t]}),this.closing=!0,this._trigger("close",t,{tooltip:n}),this.closing=!1)},_tooltip:function(t){var i=e("<div>").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")),s=i.uniqueId().attr("id");return e("<div>").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),this.tooltips[s]=t,i},_find:function(t){var i=t.data("ui-tooltip-id");return i?e("#"+i):e()},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur");n.target=n.currentTarget=s[0],t.close(n,!0),e("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title")||s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}})});
-/* JQuery UJS 3.1.4 */
-!function(e,t){e.rails!==t&&e.error("jquery-ujs has already been loaded!");var a,n=e(document);e.rails=a={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote], a[data-disable-with], a[data-disable]",buttonClickSelector:"button[data-remote]:not(form button), button[data-confirm]:not(form button)",inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])",disableSelector:"input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled",enableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled",requiredInputSelector:"input[name][required]:not([disabled]),textarea[name][required]:not([disabled])",fileInputSelector:"input[type=file]",linkDisableSelector:"a[data-disable-with], a[data-disable]",buttonDisableSelector:"button[data-remote][data-disable-with], button[data-remote][data-disable]",CSRFProtection:function(t){var a=e('meta[name="csrf-token"]').attr("content");a&&t.setRequestHeader("X-CSRF-Token",a)},refreshCSRFTokens:function(){var t=e("meta[name=csrf-token]").attr("content"),a=e("meta[name=csrf-param]").attr("content");e('form input[name="'+a+'"]').val(t)},fire:function(t,a,n){var r=e.Event(a);return t.trigger(r,n),r.result!==!1},confirm:function(e){return confirm(e)},ajax:function(t){return e.ajax(t)},href:function(e){return e[0].href},handleRemote:function(n){var r,i,o,l,s,d;if(a.fire(n,"ajax:before")){if(l=n.data("with-credentials")||null,s=n.data("type")||e.ajaxSettings&&e.ajaxSettings.dataType,n.is("form")){r=n.attr("method"),i=n.attr("action"),o=n.serializeArray();var u=n.data("ujs:submit-button");u&&(o.push(u),n.data("ujs:submit-button",null))}else n.is(a.inputChangeSelector)?(r=n.data("method"),i=n.data("url"),o=n.serialize(),n.data("params")&&(o=o+"&"+n.data("params"))):n.is(a.buttonClickSelector)?(r=n.data("method")||"get",i=n.data("url"),o=n.serialize(),n.data("params")&&(o=o+"&"+n.data("params"))):(r=n.data("method"),i=a.href(n),o=n.data("params")||null);return d={type:r||"GET",data:o,dataType:s,beforeSend:function(e,r){return r.dataType===t&&e.setRequestHeader("accept","*/*;q=0.5, "+r.accepts.script),a.fire(n,"ajax:beforeSend",[e,r])?void n.trigger("ajax:send",e):!1},success:function(e,t,a){n.trigger("ajax:success",[e,t,a])},complete:function(e,t){n.trigger("ajax:complete",[e,t])},error:function(e,t,a){n.trigger("ajax:error",[e,t,a])},crossDomain:a.isCrossDomain(i)},l&&(d.xhrFields={withCredentials:l}),i&&(d.url=i),a.ajax(d)}return!1},isCrossDomain:function(e){var t=document.createElement("a");t.href=location.href;var a=document.createElement("a");try{return a.href=e,a.href=a.href,!((!a.protocol||":"===a.protocol)&&!a.host||t.protocol+"//"+t.host==a.protocol+"//"+a.host)}catch(n){return!0}},handleMethod:function(n){var r=a.href(n),i=n.data("method"),o=n.attr("target"),l=e("meta[name=csrf-token]").attr("content"),s=e("meta[name=csrf-param]").attr("content"),d=e('<form method="post" action="'+r+'"></form>'),u='<input name="_method" value="'+i+'" type="hidden" />';s===t||l===t||a.isCrossDomain(r)||(u+='<input name="'+s+'" value="'+l+'" type="hidden" />'),o&&d.attr("target",o),d.hide().append(u).appendTo("body"),d.submit()},formElements:function(t,a){return t.is("form")?e(t[0].elements).filter(a):t.find(a)},disableFormElements:function(t){a.formElements(t,a.disableSelector).each(function(){a.disableFormElement(e(this))})},disableFormElement:function(e){var a,n;a=e.is("button")?"html":"val",n=e.data("disable-with"),e.data("ujs:enable-with",e[a]()),n!==t&&e[a](n),e.prop("disabled",!0)},enableFormElements:function(t){a.formElements(t,a.enableSelector).each(function(){a.enableFormElement(e(this))})},enableFormElement:function(e){var t=e.is("button")?"html":"val";e.data("ujs:enable-with")&&e[t](e.data("ujs:enable-with")),e.prop("disabled",!1)},allowAction:function(e){var t,n=e.data("confirm"),r=!1;return n?(a.fire(e,"confirm")&&(r=a.confirm(n),t=a.fire(e,"confirm:complete",[r])),r&&t):!0},blankInputs:function(t,a,n){var r,i,o=e(),l=a||"input,textarea",s=t.find(l);return s.each(function(){if(r=e(this),i=r.is("input[type=checkbox],input[type=radio]")?r.is(":checked"):r.val(),!i==!n){if(r.is("input[type=radio]")&&s.filter('input[type=radio]:checked[name="'+r.attr("name")+'"]').length)return!0;o=o.add(r)}}),o.length?o:!1},nonBlankInputs:function(e,t){return a.blankInputs(e,t,!0)},stopEverything:function(t){return e(t.target).trigger("ujs:everythingStopped"),t.stopImmediatePropagation(),!1},disableElement:function(e){var n=e.data("disable-with");e.data("ujs:enable-with",e.html()),n!==t&&e.html(n),e.bind("click.railsDisable",function(e){return a.stopEverything(e)})},enableElement:function(e){e.data("ujs:enable-with")!==t&&(e.html(e.data("ujs:enable-with")),e.removeData("ujs:enable-with")),e.unbind("click.railsDisable")}},a.fire(n,"rails:attachBindings")&&(e.ajaxPrefilter(function(e,t,n){e.crossDomain||a.CSRFProtection(n)}),n.delegate(a.linkDisableSelector,"ajax:complete",function(){a.enableElement(e(this))}),n.delegate(a.buttonDisableSelector,"ajax:complete",function(){a.enableFormElement(e(this))}),n.delegate(a.linkClickSelector,"click.rails",function(n){var r=e(this),i=r.data("method"),o=r.data("params"),l=n.metaKey||n.ctrlKey;if(!a.allowAction(r))return a.stopEverything(n);if(!l&&r.is(a.linkDisableSelector)&&a.disableElement(r),r.data("remote")!==t){if(l&&(!i||"GET"===i)&&!o)return!0;var s=a.handleRemote(r);return s===!1?a.enableElement(r):s.error(function(){a.enableElement(r)}),!1}return r.data("method")?(a.handleMethod(r),!1):void 0}),n.delegate(a.buttonClickSelector,"click.rails",function(t){var n=e(this);if(!a.allowAction(n))return a.stopEverything(t);n.is(a.buttonDisableSelector)&&a.disableFormElement(n);var r=a.handleRemote(n);return r===!1?a.enableFormElement(n):r.error(function(){a.enableFormElement(n)}),!1}),n.delegate(a.inputChangeSelector,"change.rails",function(t){var n=e(this);return a.allowAction(n)?(a.handleRemote(n),!1):a.stopEverything(t)}),n.delegate(a.formSubmitSelector,"submit.rails",function(n){var r,i,o=e(this),l=o.data("remote")!==t;if(!a.allowAction(o))return a.stopEverything(n);if(o.attr("novalidate")==t&&(r=a.blankInputs(o,a.requiredInputSelector),r&&a.fire(o,"ajax:aborted:required",[r])))return a.stopEverything(n);if(l){if(i=a.nonBlankInputs(o,a.fileInputSelector)){setTimeout(function(){a.disableFormElements(o)},13);var s=a.fire(o,"ajax:aborted:file",[i]);return s||setTimeout(function(){a.enableFormElements(o)},13),s}return a.handleRemote(o),!1}setTimeout(function(){a.disableFormElements(o)},13)}),n.delegate(a.formInputClickSelector,"click.rails",function(t){var n=e(this);if(!a.allowAction(n))return a.stopEverything(t);var r=n.attr("name"),i=r?{name:r,value:n.val()}:null;n.closest("form").data("ujs:submit-button",i)}),n.delegate(a.formSubmitSelector,"ajax:send.rails",function(t){this==t.target&&a.disableFormElements(e(this))}),n.delegate(a.formSubmitSelector,"ajax:complete.rails",function(t){this==t.target&&a.enableFormElements(e(this))}),e(function(){a.refreshCSRFTokens()}))}(jQuery);
+/* Rails UJS 5.12 */
+(function(){(function(){(function(){this.Rails={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]",buttonClickSelector:{selector:"button[data-remote]:not([form]), button[data-confirm]:not([form])",exclude:"form button"},inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])",formDisableSelector:"input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled",formEnableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled",fileInputSelector:"input[name][type=file]:not([disabled])",linkDisableSelector:"a[data-disable-with], a[data-disable]",buttonDisableSelector:"button[data-remote][data-disable-with], button[data-remote][data-disable]"}}).call(this)}).call(this);var t=this.Rails;(function(){(function(){var e,n;n=Element.prototype.matches||Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector,t.matches=function(t,e){return null!=e.exclude?n.call(t,e.selector)&&!n.call(t,e.exclude):n.call(t,e)},e="_ujsData",t.getData=function(t,n){var a;return null!=(a=t[e])?a[n]:void 0},t.setData=function(t,n,a){return null==t[e]&&(t[e]={}),t[e][n]=a},t.$=function(t){return Array.prototype.slice.call(document.querySelectorAll(t))}}).call(this),function(){var e,n,a;e=t.$,a=t.csrfToken=function(){var t;return t=document.querySelector("meta[name=csrf-token]"),t&&t.content},n=t.csrfParam=function(){var t;return t=document.querySelector("meta[name=csrf-param]"),t&&t.content},t.CSRFProtection=function(t){var e;return e=a(),null!=e?t.setRequestHeader("X-CSRF-Token",e):void 0},t.refreshCSRFTokens=function(){var t,o;return o=a(),t=n(),null!=o&&null!=t?e('form input[name="'+t+'"]').forEach(function(t){return t.value=o}):void 0}}.call(this),function(){var e,n,a;a=t.matches,e=window.CustomEvent,"function"!=typeof e&&(e=function(t,e){var n;return n=document.createEvent("CustomEvent"),n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n},e.prototype=window.Event.prototype),n=t.fire=function(t,n,a){var o;return o=new e(n,{bubbles:!0,cancelable:!0,detail:a}),t.dispatchEvent(o),!o.defaultPrevented},t.stopEverything=function(t){return n(t.target,"ujs:everythingStopped"),t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()},t.delegate=function(t,e,n,o){return t.addEventListener(n,function(t){var n;for(n=t.target;n instanceof Element&&!a(n,e);)n=n.parentNode;return n instanceof Element&&o.call(n,t)===!1?(t.preventDefault(),t.stopPropagation()):void 0})}}.call(this),function(){var e,n,a,o,r,i;n=t.CSRFProtection,o=t.fire,e={"*":"*/*",text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript",script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},t.ajax=function(t){var e;return t=r(t),e=a(t,function(){var n;return n=i(e.response,e.getResponseHeader("Content-Type")),2===Math.floor(e.status/100)?"function"==typeof t.success&&t.success(n,e.statusText,e):"function"==typeof t.error&&t.error(n,e.statusText,e),"function"==typeof t.complete?t.complete(e,e.statusText):void 0}),"function"==typeof t.beforeSend&&t.beforeSend(e,t),e.readyState===XMLHttpRequest.OPENED?e.send(t.data):o(document,"ajaxStop")},r=function(t){return t.url=t.url||location.href,t.type=t.type.toUpperCase(),"GET"===t.type&&t.data&&(t.url.indexOf("?")<0?t.url+="?"+t.data:t.url+="&"+t.data),null==e[t.dataType]&&(t.dataType="*"),t.accept=e[t.dataType],"*"!==t.dataType&&(t.accept+=", */*; q=0.01"),t},a=function(t,e){var a;return a=new XMLHttpRequest,a.open(t.type,t.url,!0),a.setRequestHeader("Accept",t.accept),"string"==typeof t.data&&a.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),t.crossDomain||a.setRequestHeader("X-Requested-With","XMLHttpRequest"),n(a),a.withCredentials=!!t.withCredentials,a.onreadystatechange=function(){return a.readyState===XMLHttpRequest.DONE?e(a):void 0},a},i=function(t,e){var n,a;if("string"==typeof t&&"string"==typeof e)if(e.match(/\bjson\b/))try{t=JSON.parse(t)}catch(o){}else if(e.match(/\b(?:java|ecma)script\b/))a=document.createElement("script"),a.text=t,document.head.appendChild(a).parentNode.removeChild(a);else if(e.match(/\b(xml|html|svg)\b/)){n=new DOMParser,e=e.replace(/;.+/,"");try{t=n.parseFromString(t,e)}catch(o){}}return t},t.href=function(t){return t.href},t.isCrossDomain=function(t){var e,n,a;n=document.createElement("a"),n.href=location.href,a=document.createElement("a");try{return a.href=t,!((!a.protocol||":"===a.protocol)&&!a.host||n.protocol+"//"+n.host==a.protocol+"//"+a.host)}catch(o){return e=o,!0}}}.call(this),function(){var e,n;e=t.matches,n=function(t){return Array.prototype.slice.call(t)},t.serializeElement=function(t,a){var o,r;return o=[t],e(t,"form")&&(o=n(t.elements)),r=[],o.forEach(function(t){return t.name?e(t,"select")?n(t.options).forEach(function(e){return e.selected?r.push({name:t.name,value:e.value}):void 0}):t.checked||-1===["radio","checkbox","submit"].indexOf(t.type)?r.push({name:t.name,value:t.value}):void 0:void 0}),a&&r.push(a),r.map(function(t){return null!=t.name?encodeURIComponent(t.name)+"="+encodeURIComponent(t.value):t}).join("&")},t.formElements=function(t,a){return e(t,"form")?n(t.elements).filter(function(t){return e(t,a)}):n(t.querySelectorAll(a))}}.call(this),function(){var e,n,a;n=t.fire,a=t.stopEverything,t.handleConfirm=function(t){return e(this)?void 0:a(t)},e=function(t){var e,a,o;if(o=t.getAttribute("data-confirm"),!o)return!0;if(e=!1,n(t,"confirm")){try{e=confirm(o)}catch(r){}a=n(t,"confirm:complete",[e])}return e&&a}}.call(this),function(){var e,n,a,o,r,i,l,u,c,s,d;c=t.matches,u=t.getData,s=t.setData,d=t.stopEverything,l=t.formElements,t.handleDisabledElement=function(t){var e;return e=this,e.disabled?d(t):void 0},t.enableElement=function(e){var n;return n=e instanceof Event?e.target:e,c(n,t.linkDisableSelector)?i(n):c(n,t.buttonDisableSelector)||c(n,t.formEnableSelector)?o(n):c(n,t.formSubmitSelector)?r(n):void 0},t.disableElement=function(o){var r;return r=o instanceof Event?o.target:o,c(r,t.linkDisableSelector)?a(r):c(r,t.buttonDisableSelector)||c(r,t.formDisableSelector)?e(r):c(r,t.formSubmitSelector)?n(r):void 0},a=function(t){var e;return e=t.getAttribute("data-disable-with"),null!=e&&(s(t,"ujs:enable-with",t.innerHTML),t.innerHTML=e),t.addEventListener("click",d),s(t,"ujs:disabled",!0)},i=function(t){var e;return e=u(t,"ujs:enable-with"),null!=e&&(t.innerHTML=e,s(t,"ujs:enable-with",null)),t.removeEventListener("click",d),s(t,"ujs:disabled",null)},n=function(n){return l(n,t.formDisableSelector).forEach(e)},e=function(t){var e;return e=t.getAttribute("data-disable-with"),null!=e&&(c(t,"button")?(s(t,"ujs:enable-with",t.innerHTML),t.innerHTML=e):(s(t,"ujs:enable-with",t.value),t.value=e)),t.disabled=!0,s(t,"ujs:disabled",!0)},r=function(e){return l(e,t.formEnableSelector).forEach(o)},o=function(t){var e;return e=u(t,"ujs:enable-with"),null!=e&&(c(t,"button")?t.innerHTML=e:t.value=e,s(t,"ujs:enable-with",null)),t.disabled=!1,s(t,"ujs:disabled",null)}}.call(this),function(){var e;e=t.stopEverything,t.handleMethod=function(n){var a,o,r,i,l,u,c;return u=this,(c=u.getAttribute("data-method"))?(l=t.href(u),o=t.csrfToken(),a=t.csrfParam(),r=document.createElement("form"),i="<input name='_method' value='"+c+"' type='hidden' />",null==a||null==o||t.isCrossDomain(l)||(i+="<input name='"+a+"' value='"+o+"' type='hidden' />"),i+='<input type="submit" />',r.method="post",r.action=l,r.target=u.target,r.innerHTML=i,r.style.display="none",document.body.appendChild(r),r.querySelector('[type="submit"]').click(),e(n)):void 0}}.call(this),function(){var e,n,a,o,r,i,l,u,c,s=[].slice;i=t.matches,a=t.getData,u=t.setData,n=t.fire,c=t.stopEverything,e=t.ajax,o=t.isCrossDomain,l=t.serializeElement,r=function(t){var e;return e=t.getAttribute("data-remote"),null!=e&&"false"!==e},t.handleRemote=function(d){var m,f,p,b,h,v,S;return b=this,r(b)?n(b,"ajax:before")?(S=b.getAttribute("data-with-credentials"),p=b.getAttribute("data-type")||"script",i(b,t.formSubmitSelector)?(m=a(b,"ujs:submit-button"),h=a(b,"ujs:submit-button-formmethod")||b.method,v=a(b,"ujs:submit-button-formaction")||b.getAttribute("action")||location.href,"GET"===h.toUpperCase()&&(v=v.replace(/\?.*$/,"")),"multipart/form-data"===b.enctype?(f=new FormData(b),null!=m&&f.append(m.name,m.value)):f=l(b,m),u(b,"ujs:submit-button",null),u(b,"ujs:submit-button-formmethod",null),u(b,"ujs:submit-button-formaction",null)):i(b,t.buttonClickSelector)||i(b,t.inputChangeSelector)?(h=b.getAttribute("data-method"),v=b.getAttribute("data-url"),f=l(b,b.getAttribute("data-params"))):(h=b.getAttribute("data-method"),v=t.href(b),f=b.getAttribute("data-params")),e({type:h||"GET",url:v,data:f,dataType:p,beforeSend:function(t,e){return n(b,"ajax:beforeSend",[t,e])?n(b,"ajax:send",[t]):(n(b,"ajax:stopped"),t.abort())},success:function(){var t;return t=1<=arguments.length?s.call(arguments,0):[],n(b,"ajax:success",t)},error:function(){var t;return t=1<=arguments.length?s.call(arguments,0):[],n(b,"ajax:error",t)},complete:function(){var t;return t=1<=arguments.length?s.call(arguments,0):[],n(b,"ajax:complete",t)},crossDomain:o(v),withCredentials:null!=S&&"false"!==S}),c(d)):(n(b,"ajax:stopped"),!1):!0},t.formSubmitButtonClick=function(t){var e,n;return e=this,(n=e.form)?(e.name&&u(n,"ujs:submit-button",{name:e.name,value:e.value}),u(n,"ujs:formnovalidate-button",e.formNoValidate),u(n,"ujs:submit-button-formaction",e.getAttribute("formaction")),u(n,"ujs:submit-button-formmethod",e.getAttribute("formmethod"))):void 0},t.handleMetaClick=function(t){var e,n,a,o;return n=this,o=(n.getAttribute("data-method")||"GET").toUpperCase(),e=n.getAttribute("data-params"),a=t.metaKey||t.ctrlKey,a&&"GET"===o&&!e?t.stopImmediatePropagation():void 0}}.call(this),function(){var e,n,a,o,r,i,l,u,c,s,d,m,f,p;i=t.fire,a=t.delegate,u=t.getData,e=t.$,p=t.refreshCSRFTokens,n=t.CSRFProtection,r=t.enableElement,o=t.disableElement,s=t.handleDisabledElement,c=t.handleConfirm,f=t.handleRemote,l=t.formSubmitButtonClick,d=t.handleMetaClick,m=t.handleMethod,"undefined"==typeof jQuery||null===jQuery||null==jQuery.ajax||jQuery.rails||(jQuery.rails=t,jQuery.ajaxPrefilter(function(t,e,a){return t.crossDomain?void 0:n(a)})),t.start=function(){if(window._rails_loaded)throw new Error("rails-ujs has already been loaded!");return window.addEventListener("pageshow",function(){return e(t.formEnableSelector).forEach(function(t){return u(t,"ujs:disabled")?r(t):void 0}),e(t.linkDisableSelector).forEach(function(t){return u(t,"ujs:disabled")?r(t):void 0})}),a(document,t.linkDisableSelector,"ajax:complete",r),a(document,t.linkDisableSelector,"ajax:stopped",r),a(document,t.buttonDisableSelector,"ajax:complete",r),a(document,t.buttonDisableSelector,"ajax:stopped",r),a(document,t.linkClickSelector,"click",s),a(document,t.linkClickSelector,"click",c),a(document,t.linkClickSelector,"click",d),a(document,t.linkClickSelector,"click",o),a(document,t.linkClickSelector,"click",f),a(document,t.linkClickSelector,"click",m),a(document,t.buttonClickSelector,"click",s),a(document,t.buttonClickSelector,"click",c),a(document,t.buttonClickSelector,"click",o),a(document,t.buttonClickSelector,"click",f),a(document,t.inputChangeSelector,"change",s),a(document,t.inputChangeSelector,"change",c),a(document,t.inputChangeSelector,"change",f),a(document,t.formSubmitSelector,"submit",s),a(document,t.formSubmitSelector,"submit",c),a(document,t.formSubmitSelector,"submit",f),a(document,t.formSubmitSelector,"submit",function(t){return setTimeout(function(){return o(t)},13)}),a(document,t.formSubmitSelector,"ajax:send",o),a(document,t.formSubmitSelector,"ajax:complete",r),a(document,t.formInputClickSelector,"click",s),a(document,t.formInputClickSelector,"click",c),a(document,t.formInputClickSelector,"click",l),document.addEventListener("DOMContentLoaded",p),window._rails_loaded=!0},window.Rails===t&&i(document,"rails:attachBindings")&&t.start()}.call(this)}).call(this),"object"==typeof module&&module.exports?module.exports=t:"function"==typeof define&&define.amd&&define(t)}).call(this);
diff --git a/test/extra/redmine_pm/test_case.rb b/test/extra/redmine_pm/test_case.rb
index 163a15055..1235c2a70 100644
--- a/test/extra/redmine_pm/test_case.rb
+++ b/test/extra/redmine_pm/test_case.rb
@@ -23,7 +23,7 @@ module RedminePmTest
# Cannot use transactional fixtures here: database
# will be accessed from Redmine.pm with its own connection
- self.use_transactional_fixtures = false
+ self.use_transactional_tests = false
def test_dummy
end
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 02cdf85e3..34d353263 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -6426,7 +6426,7 @@ class IssuesControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 1
with_settings :gravatar_enabled => '1' do
- get :show, :id => issue.id
+ get :show, :params => {:id => issue.id}
assert_select 'div.gravatar-with-child' do
assert_select 'img.gravatar', 1
end
@@ -6440,7 +6440,7 @@ class IssuesControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 1
with_settings :gravatar_enabled => '1' do
- get :show, :id => issue.id
+ get :show, :params => {:id => issue.id}
assert_select 'div.gravatar-with-child' do
assert_select 'img.gravatar', 2
assert_select 'img.gravatar-child', 1
diff --git a/test/functional/issues_controller_transaction_test.rb b/test/functional/issues_controller_transaction_test.rb
index 67c9d0f78..28ac868b3 100644
--- a/test/functional/issues_controller_transaction_test.rb
+++ b/test/functional/issues_controller_transaction_test.rb
@@ -44,7 +44,7 @@ class IssuesControllerTransactionTest < Redmine::ControllerTest
:journal_details,
:queries
- self.use_transactional_fixtures = false
+ self.use_transactional_tests = false
def setup
User.current = nil
diff --git a/test/functional/project_enumerations_controller_test.rb b/test/functional/project_enumerations_controller_test.rb
index f98d85965..2d87b13a7 100644
--- a/test/functional/project_enumerations_controller_test.rb
+++ b/test/functional/project_enumerations_controller_test.rb
@@ -29,7 +29,7 @@ class ProjectEnumerationsControllerTest < Redmine::ControllerTest
:custom_fields_trackers, :custom_values,
:time_entries
- self.use_transactional_fixtures = false
+ self.use_transactional_tests = false
def setup
@request.session[:user_id] = nil
diff --git a/test/functional/repositories_bazaar_controller_test.rb b/test/functional/repositories_bazaar_controller_test.rb
index ebfc35fd8..ee9021abd 100644
--- a/test/functional/repositories_bazaar_controller_test.rb
+++ b/test/functional/repositories_bazaar_controller_test.rb
@@ -17,7 +17,7 @@
require File.expand_path('../../test_helper', __FILE__)
-class RepositoriesBazaarControllerTest < Redmine::ControllerTest
+class RepositoriesBazaarControllerTest < Redmine::RepositoryControllerTest
tests RepositoriesController
fixtures :projects, :users, :email_addresses, :roles, :members, :member_roles,
@@ -29,6 +29,7 @@ class RepositoriesBazaarControllerTest < Redmine::ControllerTest
CHAR_1_UTF8_HEX = "\xc3\x9c".dup.force_encoding('UTF-8')
def setup
+ super
User.current = nil
@project = Project.find(PRJ_ID)
@repository = Repository::Bazaar.create(
diff --git a/test/functional/repositories_controller_test.rb b/test/functional/repositories_controller_test.rb
index d51efc5be..e76a2f8c4 100644
--- a/test/functional/repositories_controller_test.rb
+++ b/test/functional/repositories_controller_test.rb
@@ -17,12 +17,13 @@
require File.expand_path('../../test_helper', __FILE__)
-class RepositoriesControllerTest < Redmine::ControllerTest
+class RepositoriesControllerTest < Redmine::RepositoryControllerTest
fixtures :projects, :users, :email_addresses, :roles, :members, :member_roles, :enabled_modules,
:repositories, :issues, :issue_statuses, :changesets, :changes,
:issue_categories, :enumerations, :custom_fields, :custom_values, :trackers
def setup
+ super
User.current = nil
end
diff --git a/test/functional/repositories_cvs_controller_test.rb b/test/functional/repositories_cvs_controller_test.rb
index b2429e441..c9f26719a 100644
--- a/test/functional/repositories_cvs_controller_test.rb
+++ b/test/functional/repositories_cvs_controller_test.rb
@@ -17,7 +17,7 @@
require File.expand_path('../../test_helper', __FILE__)
-class RepositoriesCvsControllerTest < Redmine::ControllerTest
+class RepositoriesCvsControllerTest < Redmine::RepositoryControllerTest
tests RepositoriesController
fixtures :projects, :users, :email_addresses, :roles, :members, :member_roles,
@@ -31,6 +31,7 @@ class RepositoriesCvsControllerTest < Redmine::ControllerTest
NUM_REV = 7
def setup
+ super
Setting.default_language = 'en'
User.current = nil
diff --git a/test/functional/repositories_darcs_controller_test.rb b/test/functional/repositories_darcs_controller_test.rb
index dc2800f85..7b71da4dc 100644
--- a/test/functional/repositories_darcs_controller_test.rb
+++ b/test/functional/repositories_darcs_controller_test.rb
@@ -17,7 +17,7 @@
require File.expand_path('../../test_helper', __FILE__)
-class RepositoriesDarcsControllerTest < Redmine::ControllerTest
+class RepositoriesDarcsControllerTest < Redmine::RepositoryControllerTest
tests RepositoriesController
fixtures :projects, :users, :email_addresses, :roles, :members, :member_roles,
@@ -28,6 +28,7 @@ class RepositoriesDarcsControllerTest < Redmine::ControllerTest
NUM_REV = 6
def setup
+ super
User.current = nil
@project = Project.find(PRJ_ID)
@repository = Repository::Darcs.create(
diff --git a/test/functional/repositories_filesystem_controller_test.rb b/test/functional/repositories_filesystem_controller_test.rb
index 8cd12be20..1dd133c58 100644
--- a/test/functional/repositories_filesystem_controller_test.rb
+++ b/test/functional/repositories_filesystem_controller_test.rb
@@ -17,7 +17,7 @@
require File.expand_path('../../test_helper', __FILE__)
-class RepositoriesFilesystemControllerTest < Redmine::ControllerTest
+class RepositoriesFilesystemControllerTest < Redmine::RepositoryControllerTest
tests RepositoriesController
fixtures :projects, :users, :email_addresses, :roles, :members, :member_roles,
@@ -27,6 +27,7 @@ class RepositoriesFilesystemControllerTest < Redmine::ControllerTest
PRJ_ID = 3
def setup
+ super
@ruby19_non_utf8_pass = Encoding.default_external.to_s != 'UTF-8'
User.current = nil
Setting.enabled_scm << 'Filesystem' unless Setting.enabled_scm.include?('Filesystem')
diff --git a/test/functional/repositories_git_controller_test.rb b/test/functional/repositories_git_controller_test.rb
index c7cd7bce2..f1261fa5c 100644
--- a/test/functional/repositories_git_controller_test.rb
+++ b/test/functional/repositories_git_controller_test.rb
@@ -17,7 +17,7 @@
require File.expand_path('../../test_helper', __FILE__)
-class RepositoriesGitControllerTest < Redmine::ControllerTest
+class RepositoriesGitControllerTest < Redmine::RepositoryControllerTest
tests RepositoriesController
fixtures :projects, :users, :email_addresses, :roles, :members, :member_roles,
@@ -39,6 +39,7 @@ class RepositoriesGitControllerTest < Redmine::ControllerTest
JRUBY_SKIP_STR = "TODO: This test fails in JRuby"
def setup
+ super
@ruby19_non_utf8_pass = Encoding.default_external.to_s != 'UTF-8'
User.current = nil
diff --git a/test/functional/repositories_mercurial_controller_test.rb b/test/functional/repositories_mercurial_controller_test.rb
index aab018d60..7b7e98a14 100644
--- a/test/functional/repositories_mercurial_controller_test.rb
+++ b/test/functional/repositories_mercurial_controller_test.rb
@@ -17,7 +17,7 @@
require File.expand_path('../../test_helper', __FILE__)
-class RepositoriesMercurialControllerTest < Redmine::ControllerTest
+class RepositoriesMercurialControllerTest < Redmine::RepositoryControllerTest
tests RepositoriesController
fixtures :projects, :users, :email_addresses, :roles, :members, :member_roles,
@@ -31,6 +31,7 @@ class RepositoriesMercurialControllerTest < Redmine::ControllerTest
ruby19_non_utf8_pass = Encoding.default_external.to_s != 'UTF-8'
def setup
+ super
User.current = nil
@project = Project.find(PRJ_ID)
@repository = Repository::Mercurial.create(
diff --git a/test/functional/repositories_subversion_controller_test.rb b/test/functional/repositories_subversion_controller_test.rb
index ef8fcb777..f8f4b8f9d 100644
--- a/test/functional/repositories_subversion_controller_test.rb
+++ b/test/functional/repositories_subversion_controller_test.rb
@@ -17,7 +17,7 @@
require File.expand_path('../../test_helper', __FILE__)
-class RepositoriesSubversionControllerTest < Redmine::ControllerTest
+class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest
tests RepositoriesController
fixtures :projects, :users, :email_addresses, :roles, :members, :member_roles, :enabled_modules,
@@ -28,6 +28,7 @@ class RepositoriesSubversionControllerTest < Redmine::ControllerTest
NUM_REV = 11
def setup
+ super
Setting.default_language = 'en'
User.current = nil
diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb
index f5eb79a3f..42dae0f50 100644
--- a/test/functional/users_controller_test.rb
+++ b/test/functional/users_controller_test.rb
@@ -259,7 +259,7 @@ class UsersControllerTest < Redmine::ControllerTest
def test_create_with_failure
assert_no_difference 'User.count' do
- post :create, :params => {:user => {}}
+ post :create, :params => {:user => {:login => 'foo'}}
end
assert_response :success
assert_select_error /Email cannot be blank/
@@ -268,7 +268,9 @@ class UsersControllerTest < Redmine::ControllerTest
def test_create_with_failure_sould_preserve_preference
assert_no_difference 'User.count' do
post :create, :params => {
- :user => {},
+ :user => {
+ :login => 'foo'
+ },
:pref => {
'no_self_notified' => '1',
'hide_mail' => '1',
diff --git a/test/functional/welcome_controller_test.rb b/test/functional/welcome_controller_test.rb
index 710eb9ace..38533edac 100644
--- a/test/functional/welcome_controller_test.rb
+++ b/test/functional/welcome_controller_test.rb
@@ -77,13 +77,6 @@ class WelcomeControllerTest < Redmine::ControllerTest
end
end
- def test_robots
- get :robots
- assert_response :success
- assert_equal 'text/plain', @response.content_type
- assert @response.body.match(%r{^Disallow: /projects/ecookbook/issues\r?$})
- end
-
def test_warn_on_leaving_unsaved_turn_on
user = User.find(2)
user.pref.warn_on_leaving_unsaved = '1'
diff --git a/test/integration/api_test/attachments_test.rb b/test/integration/api_test/attachments_test.rb
index 0eda0b073..4983a3d64 100644
--- a/test/integration/api_test/attachments_test.rb
+++ b/test/integration/api_test/attachments_test.rb
@@ -71,7 +71,7 @@ class Redmine::ApiTest::AttachmentsTest < Redmine::ApiTest::Base
test "GET /attachments/download/:id/:filename should deny access without credentials" do
get '/attachments/download/7/archive.zip'
- assert_response 302
+ assert_response 401
set_tmp_attachments_directory
end
diff --git a/test/integration/application_test.rb b/test/integration/application_test.rb
index 2b572a238..7990b4265 100644
--- a/test/integration/application_test.rb
+++ b/test/integration/application_test.rb
@@ -63,9 +63,9 @@ class ApplicationTest < Redmine::IntegrationTest
assert_nil session[:user_id]
end
- def test_missing_template_should_respond_with_404
+ def test_missing_template_should_respond_with_4xx
get '/login.png'
- assert_response 404
+ assert_response 406
end
def test_invalid_token_should_call_custom_handler
diff --git a/test/integration/lib/redmine/field_format/attachment_format_test.rb b/test/integration/lib/redmine/field_format/attachment_format_test.rb
index 2510b7c64..759a73b17 100644
--- a/test/integration/lib/redmine/field_format/attachment_format_test.rb
+++ b/test/integration/lib/redmine/field_format/attachment_format_test.rb
@@ -85,7 +85,7 @@ class AttachmentFieldFormatTest < Redmine::IntegrationTest
# preview the attachment
get link.attr('href')
assert_response :success
- assert_template :file
+ assert_select 'h2', :text => 'testfile.txt'
end
def test_create_without_attachment
diff --git a/test/integration/routing/attachments_test.rb b/test/integration/routing/attachments_test.rb
index cf417cee5..096591f2d 100644
--- a/test/integration/routing/attachments_test.rb
+++ b/test/integration/routing/attachments_test.rb
@@ -20,7 +20,8 @@ require File.expand_path('../../../test_helper', __FILE__)
class RoutingAttachmentsTest < Redmine::RoutingTest
def test_attachments
should_route 'GET /attachments/1' => 'attachments#show', :id => '1'
- should_route 'GET /attachments/1/filename.ext' => 'attachments#show', :id => '1', :filename => 'filename.ext'
+ should_route 'GET /attachments/1/filename.ext' => 'attachments#show', :id => '1', :filename => 'filename.ext', :format => 'html'
+ should_route 'GET /attachments/1/filename.txt' => 'attachments#show', :id => '1', :filename => 'filename.txt', :format => 'html'
should_route 'GET /attachments/download/1' => 'attachments#download', :id => '1'
should_route 'GET /attachments/download/1/filename.ext' => 'attachments#download', :id => '1', :filename => 'filename.ext'
diff --git a/test/integration/routing/repositories_test.rb b/test/integration/routing/repositories_test.rb
index e0b9d9e6a..337686169 100644
--- a/test/integration/routing/repositories_test.rb
+++ b/test/integration/routing/repositories_test.rb
@@ -18,15 +18,15 @@
require File.expand_path('../../../test_helper', __FILE__)
class RoutingRepositoriesTest < Redmine::RoutingTest
+
def setup
- @path_hash = repository_path_hash(%w[path to file.c])
- assert_equal "path/to/file.c", @path_hash[:path]
- assert_equal "path/to/file.c", @path_hash[:param]
+ @paths = ['path/to/file.c', 'path/to/index.html']
end
def test_repositories_resources
should_route 'GET /projects/foo/repositories/new' => 'repositories#new', :project_id => 'foo'
should_route 'POST /projects/foo/repositories' => 'repositories#create', :project_id => 'foo'
+
should_route 'GET /repositories/1/edit' => 'repositories#edit', :id => '1'
should_route 'PUT /repositories/1' => 'repositories#update', :id => '1'
should_route 'DELETE /repositories/1' => 'repositories#destroy', :id => '1'
@@ -53,19 +53,15 @@ class RoutingRepositoriesTest < Redmine::RoutingTest
should_route 'GET /projects/foo/repository/revisions.atom' => 'repositories#revisions', :id => 'foo', :format => 'atom'
should_route 'GET /projects/foo/repository/revisions/2457' => 'repositories#revision', :id => 'foo', :rev => '2457'
- should_route 'GET /projects/foo/repository/revisions/2457/show' => 'repositories#show', :id => 'foo', :rev => '2457'
- should_route 'GET /projects/foo/repository/revisions/2457/diff' => 'repositories#diff', :id => 'foo', :rev => '2457'
-
- should_route "GET /projects/foo/repository/revisions/2457/show/#{@path_hash[:path]}" => 'repositories#show',
- :id => 'foo', :rev => '2457', :path => @path_hash[:param]
- should_route "GET /projects/foo/repository/revisions/2457/diff/#{@path_hash[:path]}" => 'repositories#diff',
- :id => 'foo', :rev => '2457', :path => @path_hash[:param]
- should_route "GET /projects/foo/repository/revisions/2457/entry/#{@path_hash[:path]}" => 'repositories#entry',
- :id => 'foo', :rev => '2457', :path => @path_hash[:param]
- should_route "GET /projects/foo/repository/revisions/2457/raw/#{@path_hash[:path]}" => 'repositories#raw',
- :id => 'foo', :rev => '2457', :path => @path_hash[:param]
- should_route "GET /projects/foo/repository/revisions/2457/annotate/#{@path_hash[:path]}" => 'repositories#annotate',
- :id => 'foo', :rev => '2457', :path => @path_hash[:param]
+ should_route 'GET /projects/foo/repository/revisions/2457/show' => 'repositories#show', :id => 'foo', :rev => '2457', :format => 'html'
+ should_route 'GET /projects/foo/repository/revisions/2457/diff' => 'repositories#diff', :id => 'foo', :rev => '2457', :format => 'html'
+
+ %w(show diff entry raw annotate).each do |action|
+ @paths.each do |path|
+ should_route "GET /projects/foo/repository/revisions/2457/#{action}/#{path}" => "repositories##{action}",
+ :id => 'foo', :rev => '2457', :path => path, :format => 'html'
+ end
+ end
end
def test_repositories_revisions_with_repository_id
@@ -74,53 +70,37 @@ class RoutingRepositoriesTest < Redmine::RoutingTest
should_route 'GET /projects/foo/repository/foo/revisions.atom' => 'repositories#revisions', :id => 'foo', :repository_id => 'foo', :format => 'atom'
should_route 'GET /projects/foo/repository/foo/revisions/2457' => 'repositories#revision', :id => 'foo', :repository_id => 'foo', :rev => '2457'
- should_route 'GET /projects/foo/repository/foo/revisions/2457/show' => 'repositories#show', :id => 'foo', :repository_id => 'foo', :rev => '2457'
- should_route 'GET /projects/foo/repository/foo/revisions/2457/diff' => 'repositories#diff', :id => 'foo', :repository_id => 'foo', :rev => '2457'
-
- should_route "GET /projects/foo/repository/foo/revisions/2457/show/#{@path_hash[:path]}" => 'repositories#show',
- :id => 'foo', :repository_id => 'foo', :rev => '2457', :path => @path_hash[:param]
- should_route "GET /projects/foo/repository/foo/revisions/2457/diff/#{@path_hash[:path]}" => 'repositories#diff',
- :id => 'foo', :repository_id => 'foo', :rev => '2457', :path => @path_hash[:param]
- should_route "GET /projects/foo/repository/foo/revisions/2457/entry/#{@path_hash[:path]}" => 'repositories#entry',
- :id => 'foo', :repository_id => 'foo', :rev => '2457', :path => @path_hash[:param]
- should_route "GET /projects/foo/repository/foo/revisions/2457/raw/#{@path_hash[:path]}" => 'repositories#raw',
- :id => 'foo', :repository_id => 'foo', :rev => '2457', :path => @path_hash[:param]
- should_route "GET /projects/foo/repository/foo/revisions/2457/annotate/#{@path_hash[:path]}" => 'repositories#annotate',
- :id => 'foo', :repository_id => 'foo', :rev => '2457', :path => @path_hash[:param]
+ should_route 'GET /projects/foo/repository/foo/revisions/2457/show' => 'repositories#show', :id => 'foo', :repository_id => 'foo', :rev => '2457', :format => 'html'
+ should_route 'GET /projects/foo/repository/foo/revisions/2457/diff' => 'repositories#diff', :id => 'foo', :repository_id => 'foo', :rev => '2457', :format => 'html'
+
+ %w(show diff entry raw annotate).each do |action|
+ @paths.each do |path|
+ should_route "GET /projects/foo/repository/foo/revisions/2457/#{action}/#{path}" => "repositories##{action}",
+ :id => 'foo', :repository_id => 'foo', :rev => '2457', :path => path, :format => 'html'
+ end
+ end
end
def test_repositories_non_revisions_path
- should_route 'GET /projects/foo/repository/changes' => 'repositories#changes', :id => 'foo'
-
- should_route "GET /projects/foo/repository/changes/#{@path_hash[:path]}" => 'repositories#changes',
- :id => 'foo', :path => @path_hash[:param]
- should_route "GET /projects/foo/repository/diff/#{@path_hash[:path]}" => 'repositories#diff',
- :id => 'foo', :path => @path_hash[:param]
- should_route "GET /projects/foo/repository/browse/#{@path_hash[:path]}" => 'repositories#browse',
- :id => 'foo', :path => @path_hash[:param]
- should_route "GET /projects/foo/repository/entry/#{@path_hash[:path]}" => 'repositories#entry',
- :id => 'foo', :path => @path_hash[:param]
- should_route "GET /projects/foo/repository/raw/#{@path_hash[:path]}" => 'repositories#raw',
- :id => 'foo', :path => @path_hash[:param]
- should_route "GET /projects/foo/repository/annotate/#{@path_hash[:path]}" => 'repositories#annotate',
- :id => 'foo', :path => @path_hash[:param]
+ should_route 'GET /projects/foo/repository/changes' => 'repositories#changes', :id => 'foo', :format => 'html'
+
+ %w(changes diff browse entry raw annotate).each do |action|
+ @paths.each do |path|
+ should_route "GET /projects/foo/repository/#{action}/#{path}" => "repositories##{action}",
+ :id => 'foo', :path => path, :format => 'html'
+ end
+ end
end
def test_repositories_non_revisions_path_with_repository_id
- should_route 'GET /projects/foo/repository/svn/changes' => 'repositories#changes', :id => 'foo', :repository_id => 'svn'
-
- should_route "GET /projects/foo/repository/svn/changes/#{@path_hash[:path]}" => 'repositories#changes',
- :id => 'foo', :repository_id => 'svn', :path => @path_hash[:param]
- should_route "GET /projects/foo/repository/svn/diff/#{@path_hash[:path]}" => 'repositories#diff',
- :id => 'foo', :repository_id => 'svn', :path => @path_hash[:param]
- should_route "GET /projects/foo/repository/svn/browse/#{@path_hash[:path]}" => 'repositories#browse',
- :id => 'foo', :repository_id => 'svn', :path => @path_hash[:param]
- should_route "GET /projects/foo/repository/svn/entry/#{@path_hash[:path]}" => 'repositories#entry',
- :id => 'foo', :repository_id => 'svn', :path => @path_hash[:param]
- should_route "GET /projects/foo/repository/svn/raw/#{@path_hash[:path]}" => 'repositories#raw',
- :id => 'foo', :repository_id => 'svn', :path => @path_hash[:param]
- should_route "GET /projects/foo/repository/svn/annotate/#{@path_hash[:path]}" => 'repositories#annotate',
- :id => 'foo', :repository_id => 'svn', :path => @path_hash[:param]
+ should_route 'GET /projects/foo/repository/svn/changes' => 'repositories#changes', :id => 'foo', :repository_id => 'svn', :format => 'html'
+
+ %w(changes diff browse entry raw annotate).each do |action|
+ @paths.each do |path|
+ should_route "GET /projects/foo/repository/svn/#{action}/#{path}" => "repositories##{action}",
+ :id => 'foo', :repository_id => 'svn', :path => path, :format => 'html'
+ end
+ end
end
def test_repositories_related_issues
diff --git a/test/integration/routing/welcome_test.rb b/test/integration/routing/welcome_test.rb
index 68aaf5a13..ad064f35d 100644
--- a/test/integration/routing/welcome_test.rb
+++ b/test/integration/routing/welcome_test.rb
@@ -20,6 +20,6 @@ require File.expand_path('../../../test_helper', __FILE__)
class RoutingWelcomeTest < Redmine::RoutingTest
def test_welcome
should_route 'GET /' => 'welcome#index'
- should_route 'GET /robots.txt' => 'welcome#robots'
+ should_route 'GET /robots.txt' => 'welcome#robots', :format => 'txt'
end
end
diff --git a/test/integration/welcome_test.rb b/test/integration/welcome_test.rb
new file mode 100644
index 000000000..3577fe059
--- /dev/null
+++ b/test/integration/welcome_test.rb
@@ -0,0 +1,28 @@
+# Redmine - project management software
+# Copyright (C) 2006-2017 Jean-Philippe Lang
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+require File.expand_path('../../test_helper', __FILE__)
+
+class WelcomeTest < Redmine::IntegrationTest
+
+ def test_robots
+ get '/robots.txt'
+ assert_response :success
+ assert_equal 'text/plain', @response.content_type
+ assert @response.body.match(%r{^Disallow: /projects/ecookbook/issues\r?$})
+ end
+end
diff --git a/test/test_helper.rb b/test/test_helper.rb
index ffb2d7055..34aebd4d2 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -49,7 +49,7 @@ end
class ActiveSupport::TestCase
include ActionDispatch::TestProcess
- self.use_transactional_fixtures = true
+ self.use_transactional_tests = true
self.use_instantiated_fixtures = false
def uploaded_test_file(name, mime)
@@ -324,16 +324,16 @@ module Redmine
end
assert_equal expected_filters.size, filter_init.scan("addFilter").size, "filters counts don't match"
end
+ end
- def process(action, http_method = 'GET', *args)
- parameters, session, flash = *args
- if args.size == 1 && parameters[:xhr] == true
- xhr http_method.downcase.to_sym, action, parameters.except(:xhr)
- elsif parameters && (parameters.key?(:params) || parameters.key?(:session) || parameters.key?(:flash))
- super action, http_method, parameters[:params], parameters[:session], parameters[:flash]
- else
- super
- end
+ class RepositoryControllerTest < ControllerTest
+ def setup
+ super
+ # We need to explicitly set Accept header to html otherwise
+ # requests that ends with a known format like:
+ # GET /projects/foo/repository/entry/image.png would be
+ # treated as image/png requests, resulting in a 406 error.
+ request.env["HTTP_ACCEPT"] = "text/html"
end
end
@@ -344,21 +344,13 @@ module Redmine
assert_nil session[:user_id]
assert_response :success
- post "/login", :username => login, :password => password
+ post "/login", :params => {
+ :username => login,
+ :password => password
+ }
assert_equal login, User.find(session[:user_id]).login
end
- %w(get post patch put delete head).each do |http_method|
- class_eval %Q"
- def #{http_method}(path, parameters = nil, headers_or_env = nil)
- if headers_or_env.nil? && parameters.is_a?(Hash) && (parameters.key?(:params) || parameters.key?(:headers))
- super path, parameters[:params], parameters[:headers]
- else
- super
- end
- end"
- end
-
def credentials(user, password=nil)
{'HTTP_AUTHORIZATION' => ActionController::HttpAuthentication::Basic.encode_credentials(user, password || user)}
end
@@ -390,7 +382,9 @@ module Redmine
def upload(format, content, credentials)
set_tmp_attachments_directory
assert_difference 'Attachment.count' do
- post "/uploads.#{format}", content, {"CONTENT_TYPE" => 'application/octet-stream'}.merge(credentials)
+ post "/uploads.#{format}",
+ :params => content,
+ :headers => {"CONTENT_TYPE" => 'application/octet-stream'}.merge(credentials)
assert_response :created
end
data = response_data
diff --git a/test/ui/base.rb b/test/ui/base.rb
index 556e35a46..d4ecff985 100644
--- a/test/ui/base.rb
+++ b/test/ui/base.rb
@@ -77,7 +77,7 @@ module Redmine
# Stop ActiveRecord from wrapping tests in transactions
# Transactional fixtures do not work with Selenium tests, because Capybara
# uses a separate server thread, which the transactions would be hidden
- self.use_transactional_fixtures = false
+ self.use_transactional_tests = false
# Should not depend on locale since Redmine displays login page
# using default browser locale which depend on system locale for "real" browsers drivers
diff --git a/test/unit/attachment_test.rb b/test/unit/attachment_test.rb
index e55c60b86..dcad6f23d 100644
--- a/test/unit/attachment_test.rb
+++ b/test/unit/attachment_test.rb
@@ -23,10 +23,6 @@ class AttachmentTest < ActiveSupport::TestCase
fixtures :users, :email_addresses, :projects, :roles, :members, :member_roles,
:enabled_modules, :issues, :trackers, :attachments
- # TODO: remove this with Rails 5 that supports after_commit callbacks
- # in transactional fixtures (https://github.com/rails/rails/pull/18458)
- self.use_transactional_fixtures = false
-
def setup
set_tmp_attachments_directory
end
diff --git a/test/unit/attachment_transaction_test.rb b/test/unit/attachment_transaction_test.rb
index 44776c8f5..b0f13332f 100644
--- a/test/unit/attachment_transaction_test.rb
+++ b/test/unit/attachment_transaction_test.rb
@@ -23,7 +23,7 @@ class AttachmentTest < ActiveSupport::TestCase
fixtures :users, :email_addresses, :projects, :roles, :members, :member_roles,
:enabled_modules, :issues, :trackers, :attachments
- self.use_transactional_fixtures = false
+ self.use_transactional_tests = false
def setup
set_tmp_attachments_directory
diff --git a/test/unit/issue_nested_set_concurrency_test.rb b/test/unit/issue_nested_set_concurrency_test.rb
index 4345fffc7..2f8daf8c8 100644
--- a/test/unit/issue_nested_set_concurrency_test.rb
+++ b/test/unit/issue_nested_set_concurrency_test.rb
@@ -24,7 +24,7 @@ class IssueNestedSetConcurrencyTest < ActiveSupport::TestCase
:issue_statuses,
:enumerations
- self.use_transactional_fixtures = false
+ self.use_transactional_tests = false
def setup
skip if sqlite?
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index df242a169..a01d2e3e1 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -3045,14 +3045,14 @@ class IssueTest < ActiveSupport::TestCase
assert_equal IssueStatus.find(3), issue.status
end
- def test_assigned_to_was_with_a_group
+ def test_previous_assignee_with_a_group
group = Group.find(10)
Member.create!(:project_id => 1, :principal => group, :role_ids => [1])
with_settings :issue_group_assignment => '1' do
issue = Issue.generate!(:assigned_to => group)
issue.reload.assigned_to = nil
- assert_equal group, issue.assigned_to_was
+ assert_equal group, issue.previous_assignee
end
end
diff --git a/test/unit/issue_transaction_test.rb b/test/unit/issue_transaction_test.rb
index bb30df5d2..f944ffe8e 100644
--- a/test/unit/issue_transaction_test.rb
+++ b/test/unit/issue_transaction_test.rb
@@ -27,7 +27,7 @@ class IssueTransactionTest < ActiveSupport::TestCase
:custom_fields, :custom_fields_projects, :custom_fields_trackers, :custom_values,
:time_entries
- self.use_transactional_fixtures = false
+ self.use_transactional_tests = false
def test_invalid_move_to_another_project
lft1 = new_issue_lft
diff --git a/test/unit/lib/redmine/views/builders/json_test.rb b/test/unit/lib/redmine/views/builders/json_test.rb
index 8a0bd1032..b1b50b80a 100644
--- a/test/unit/lib/redmine/views/builders/json_test.rb
+++ b/test/unit/lib/redmine/views/builders/json_test.rb
@@ -87,7 +87,7 @@ class Redmine::Views::Builders::JsonTest < ActiveSupport::TestCase
end
def assert_json_output(expected, &block)
- builder = Redmine::Views::Builders::Json.new(ActionDispatch::TestRequest.new, ActionDispatch::TestResponse.new)
+ builder = Redmine::Views::Builders::Json.new(ActionDispatch::TestRequest.create, ActionDispatch::TestResponse.create)
block.call(builder)
assert_equal(expected, ActiveSupport::JSON.decode(builder.output))
end
diff --git a/test/unit/lib/redmine/views/builders/xml_test.rb b/test/unit/lib/redmine/views/builders/xml_test.rb
index cdc1ec2cf..46b5755b0 100644
--- a/test/unit/lib/redmine/views/builders/xml_test.rb
+++ b/test/unit/lib/redmine/views/builders/xml_test.rb
@@ -60,7 +60,7 @@ class Redmine::Views::Builders::XmlTest < ActiveSupport::TestCase
end
def assert_xml_output(expected, &block)
- builder = Redmine::Views::Builders::Xml.new(ActionDispatch::TestRequest.new, ActionDispatch::TestResponse.new)
+ builder = Redmine::Views::Builders::Xml.new(ActionDispatch::TestRequest.create, ActionDispatch::TestResponse.create)
block.call(builder)
assert_equal('<?xml version="1.0" encoding="UTF-8"?>' + expected, builder.output)
end
diff --git a/test/unit/project_nested_set_concurrency_test.rb b/test/unit/project_nested_set_concurrency_test.rb
index b67e5b3e3..430aab175 100644
--- a/test/unit/project_nested_set_concurrency_test.rb
+++ b/test/unit/project_nested_set_concurrency_test.rb
@@ -18,7 +18,7 @@
require File.expand_path('../../test_helper', __FILE__)
class ProjectNestedSetConcurrencyTest < ActiveSupport::TestCase
- self.use_transactional_fixtures = false
+ self.use_transactional_tests = false
def setup
CustomField.delete_all