OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Chore/rename timestamps (#8765)
ulferts6cce947cbd06
diff --git a/app/cells/users/table_cell.rb b/app/cells/users/table_cell.rbindex 360fea0c815..dc2e7ffd341 100644--- a/app/cells/users/table_cell.rb+++ b/app/cells/users/table_cell.rb@@ -1,7 +1,7 @@module Usersclass TableCell < ::TableCelloptions :current_user # adds this option to those of the base class- columns :login, :firstname, :lastname, :mail, :admin, :created_on, :last_login_on+ columns :login, :firstname, :lastname, :mail, :admin, :created_at, :last_login_ondef initial_sort[:id, :asc]@@ -22,7 +22,7 @@ module Usersenddef desc_by_default- [:admin, :created_on, :last_login_on]+ [:admin, :created_at, :last_login_on]endendenddiff --git a/app/controllers/enterprises_controller.rb b/app/controllers/enterprises_controller.rbindex 73cbeb10ecd..b209cdda1eb 100644--- a/app/controllers/enterprises_controller.rb+++ b/app/controllers/enterprises_controller.rb@@ -103,7 +103,7 @@ class EnterprisesController < ApplicationControllerif @trial_keygon.ee_trial_key = {value: @trial_key.value,- created: @trial_key.created_on+ created: @trial_key.created_at}endenddiff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rbindex ffaea91cb11..985ecfb8d33 100644--- a/app/controllers/forums_controller.rb+++ b/app/controllers/forums_controller.rb@@ -48,10 +48,10 @@ class ForumsController < ApplicationControllerenddef show- sort_init 'updated_on', 'desc'- sort_update 'created_on' => "#{Message.table_name}.created_on",+ sort_init 'updated_at', 'desc'+ sort_update 'created_at' => "#{Message.table_name}.created_at",'replies' => "#{Message.table_name}.replies_count",- 'updated_on' => "#{Message.table_name}.updated_on"+ 'updated_at' => "#{Message.table_name}.updated_at"respond_to do |format|format.html dodiff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rbindex f2a2c6e35f8..e626d84a149 100644--- a/app/controllers/messages_controller.rb+++ b/app/controllers/messages_controller.rb@@ -51,10 +51,12 @@ class MessagesController < ApplicationControllerpage = 1 + offset / REPLIES_PER_PAGEend- @replies = @topic.children.includes(:author, :attachments, forum: :project)- .order("#{Message.table_name}.created_on ASC")- .page(page)- .per_page(per_page_param)+ @replies = @topic+ .children+ .includes(:author, :attachments, forum: :project)+ .order(created_at: :asc)+ .page(page)+ .per_page(per_page_param)@reply = Message.new(subject: "RE: #{@message.subject}", parent: @topic, forum: @topic.forum)render action: 'show', layout: !request.xhr?diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rbindex 18c786cc01f..1439e9556c0 100644--- a/app/controllers/wiki_controller.rb+++ b/app/controllers/wiki_controller.rb@@ -87,7 +87,7 @@ class WikiController < ApplicationController# List of page, by last updatedef date_indexload_pages_for_index- @pages_by_date = @pages.group_by { |p| p.updated_on.to_date }+ @pages_by_date = @pages.group_by { |p| p.updated_at.to_date }enddef new; end@@ -424,7 +424,7 @@ class WikiController < ApplicationControllerenddef load_pages_for_index- @pages = @wiki.pages.with_updated_on.order(Arel.sql('title')).includes(wiki: :project)+ @pages = @wiki.pages.with_updated_at.order(Arel.sql('title')).includes(wiki: :project)enddef default_breadcrumbdiff --git a/app/mailers/base_mailer.rb b/app/mailers/base_mailer.rbindex edb8a117acf..ed13eaa23f7 100644--- a/app/mailers/base_mailer.rb+++ b/app/mailers/base_mailer.rb@@ -78,11 +78,7 @@ class BaseMailer < ActionMailer::Baseenddef mail_timestamp(object)- if object.respond_to? :created_at- object.send(object.respond_to?(:created_at) ? :created_at : :updated_at)- else- object.send(object.respond_to?(:created_on) ? :created_on : :updated_on)- end+ object.send(object.respond_to?(:created_at) ? :created_at : :updated_at)enddef hostdiff --git a/app/models/changeset.rb b/app/models/changeset.rbindex 84f463e0fec..6363e4b1448 100644--- a/app/models/changeset.rb+++ b/app/models/changeset.rb@@ -33,7 +33,7 @@ class Changeset < ApplicationRecordhas_many :file_changes, class_name: 'Change', dependent: :delete_allhas_and_belongs_to_many :work_packages- acts_as_journalized+ acts_as_journalized timestamp: :committed_onacts_as_event title: Proc.new { |o|"#{I18n.t(:label_revision)} #{o.format_identifier}" + (o.short_comments.blank? ? '' : (': ' + o.short_comments))diff --git a/app/models/journal/scopes/aggregated_journal.rb b/app/models/journal/scopes/aggregated_journal.rbindex e4878dcef1b..ccca1c8b701 100644--- a/app/models/journal/scopes/aggregated_journal.rb+++ b/app/models/journal/scopes/aggregated_journal.rb@@ -256,6 +256,7 @@ module Journal::Scopes#{notes_in_group_alias}.version notes_version,#{version_projection} AS version,#{created_at_projection} created_at,+ #{updated_at_projection} updated_at,#{id_projection} idSQL@@ -263,26 +264,26 @@ module Journal::Scopesenddef id_projection- <<~SQL- CASE- WHEN successor_notes.version IS NOT NULL THEN #{notes_in_group_alias}.id- ELSE #{end_group_journals_alias}.id END- SQL+ attribute_projection(:id)enddef version_projection- <<~SQL- CASE- WHEN successor_notes.version IS NOT NULL THEN #{notes_in_group_alias}.version- ELSE #{end_group_journals_alias}.version END- SQL+ attribute_projection(:version)enddef created_at_projection+ attribute_projection(:created_at)+ end++ def updated_at_projection+ attribute_projection(:updated_at)+ end++ def attribute_projection(attribute)<<~SQLCASE- WHEN successor_notes.version IS NOT NULL THEN #{notes_in_group_alias}.created_at- ELSE #{end_group_journals_alias}.created_at END+ WHEN successor_notes.version IS NOT NULL THEN #{notes_in_group_alias}.#{attribute}+ ELSE #{end_group_journals_alias}.#{attribute} ENDSQLenddiff --git a/app/models/journal_version.rb b/app/models/journal_version.rbdeleted file mode 100644index 9fb31575355..00000000000--- a/app/models/journal_version.rb+++ /dev/null@@ -1,31 +0,0 @@-#-- encoding: UTF-8-#-- copyright-# OpenProject is an open source project management software.-# Copyright (C) 2012-2020 the OpenProject GmbH-#-# This program is free software; you can redistribute it and/or-# modify it under the terms of the GNU General Public License version 3.-#-# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:-# Copyright (C) 2006-2017 Jean-Philippe Lang-# Copyright (C) 2010-2013 the ChiliProject Team-#-# 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.-#-# See docs/COPYRIGHT.rdoc for more details.-#++--class JournalVersion < ActiveRecord::Base-enddiff --git a/app/models/message.rb b/app/models/message.rbindex c45f1ed5b99..8aeafd10098 100644--- a/app/models/message.rb+++ b/app/models/message.rb@@ -33,7 +33,7 @@ class Message < ApplicationRecordbelongs_to :forumhas_one :project, through: :forumbelongs_to :author, class_name: 'User', foreign_key: 'author_id'- acts_as_tree counter_cache: :replies_count, order: "#{Message.table_name}.created_on ASC"+ acts_as_tree counter_cache: :replies_count, order: "#{Message.table_name}.created_at ASC"acts_as_attachable after_add: :attachments_changed,after_remove: :attachments_changed,add_on_new_permission: :add_messages,@@ -44,7 +44,6 @@ class Message < ApplicationRecordacts_as_event title: Proc.new { |o| "#{o.forum.name}: #{o.subject}" },description: :content,- datetime: :created_on,type: Proc.new { |o| o.parent_id.nil? ? 'message' : 'reply' },url: (Proc.new do |o|msg = o@@ -59,7 +58,7 @@ class Message < ApplicationRecordinclude: { forum: :project },references: [:forums],project_key: 'project_id',- date_column: "#{table_name}.created_on"+ date_column: "#{table_name}.created_at"acts_as_watchablediff --git a/app/models/news.rb b/app/models/news.rbindex aa704a5d3f6..3cd83000f57 100644--- a/app/models/news.rb+++ b/app/models/news.rb@@ -31,7 +31,7 @@ class News < ApplicationRecordbelongs_to :projectbelongs_to :author, class_name: 'User', foreign_key: 'author_id'has_many :comments, -> {- order('created_on')+ order(:created_at)}, as: :commented, dependent: :delete_allvalidates_presence_of :title@@ -40,8 +40,7 @@ class News < ApplicationRecordacts_as_journalized- acts_as_event url: Proc.new { |o| { controller: '/news', action: 'show', id: o.id } },- datetime: :created_at+ acts_as_event url: Proc.new { |o| { controller: '/news', action: 'show', id: o.id } }acts_as_searchable columns: ["#{table_name}.title", "#{table_name}.summary", "#{table_name}.description"],include: :project,diff --git a/app/models/setting.rb b/app/models/setting.rbindex c8f9e648f2c..28acb812496 100644--- a/app/models/setting.rb+++ b/app/models/setting.rb@@ -165,7 +165,7 @@ class Setting < ApplicationRecordnew_setting.value = v# Keep the current cache key,- # since updated_on will change after .save+ # since updated_at will change after .saveold_cache_key = cache_keyif new_setting.save@@ -235,7 +235,7 @@ class Setting < ApplicationRecorddef self.clear_cache(key = cache_key)Rails.cache.delete(key)RequestStore.delete :cached_settings- RequestStore.delete :settings_updated_on+ RequestStore.delete :settings_updated_atendprivate@@ -281,8 +281,8 @@ class Setting < ApplicationRecordenddef self.cache_key- RequestStore.store[:settings_updated_on] ||= Setting.maximum(:updated_on)- most_recent_settings_change = (RequestStore.store[:settings_updated_on] || Time.now.utc).to_i+ RequestStore.store[:settings_updated_at] ||= Setting.column_names.include?(:updated_at) && Setting.maximum(:updated_at)+ most_recent_settings_change = (RequestStore.store[:settings_updated_at] || Time.now.utc).to_i"/openproject/settings/all/#{most_recent_settings_change}"enddiff --git a/app/models/user.rb b/app/models/user.rbindex a16dd216ff0..482bc585d6f 100644--- a/app/models/user.rb+++ b/app/models/user.rb@@ -169,7 +169,7 @@ class User < Principalscope :admin, -> { where(admin: true) }- scope :newest, -> { not_builtin.order(created_on: :desc) }+ scope :newest, -> { not_builtin.order(created_at: :desc) }def self.unique_attribute:login@@ -302,7 +302,7 @@ class User < Principaltoken = Token::AutoLogin.find_by_plaintext_value(key)# Make sure there's only 1 token that matches the keyif token- if (token.created_on > Setting.autologin.to_i.day.ago) && token.user && token.user.active?+ if (token.created_at > Setting.autologin.to_i.day.ago) && token.user && token.user.active?token.user.log_successful_logintoken.userenddiff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rbindex 861e64d01ae..b9f7cb52884 100644--- a/app/models/wiki_page.rb+++ b/app/models/wiki_page.rb@@ -44,7 +44,6 @@ class WikiPage < ApplicationRecordacts_as_watchableacts_as_event title: Proc.new { |o| "#{Wiki.model_name.human}: #{o.title}" },description: :text,- datetime: :created_on,url: Proc.new { |o| { controller: '/wiki', action: 'show', project_id: o.wiki.project, id: o.title } }acts_as_searchable columns: ["#{WikiPage.table_name}.title", "#{WikiContent.table_name}.text"],@@ -65,8 +64,8 @@ class WikiPage < ApplicationRecordbefore_destroy :remove_redirects# eager load information about last updates, without loading text- scope :with_updated_on, -> {- select("#{WikiPage.table_name}.*, #{WikiContent.table_name}.updated_on")+ scope :with_updated_at, -> {+ select("#{WikiPage.table_name}.*, #{WikiContent.table_name}.updated_at").joins("LEFT JOIN #{WikiContent.table_name} ON #{WikiContent.table_name}.page_id = #{WikiPage.table_name}.id")}@@ -87,7 +86,7 @@ class WikiPage < ApplicationRecordenddef delete_wiki_menu_item- menu_item.destroy if menu_item+ menu_item&.destroy# ensure there is a menu item for the wikiwiki.create_menu_item_for_start_page if MenuItems::WikiMenuItem.main_items(wiki).empty?end@@ -137,7 +136,7 @@ class WikiPage < ApplicationRecordunless journal.nil? || content.version == journal.versioncontent_version = WikiContent.new journal.data.attributes.except('id', 'journal_id')- content_version.updated_on = journal.created_at+ content_version.updated_at = journal.created_atcontent_version.journals = content.journals.select { |j| j.version <= version.to_i }content_version@@ -164,22 +163,22 @@ class WikiPage < ApplicationRecordenddef text- content.text if content+ content&.textend- def updated_on- unless @updated_on- if time = read_attribute(:updated_on)- # content updated_on was eager loaded with the page+ def updated_at+ unless @updated_at+ if (time = read_attribute(:updated_at))+ # content updated_at was eager loaded with the pageunless time.is_a? Timetime = Time.zone.parse(time) rescue nilend- @updated_on = time+ @updated_at = timeelse- @updated_on = content && content.updated_on+ @updated_at = content&.updated_atendend- @updated_on+ @updated_atend# Returns true if usr is allowed to edit the page, otherwise false@@ -192,7 +191,7 @@ class WikiPage < ApplicationRecordenddef parent_title- @parent_title || (parent && parent.title)+ @parent_title || (parent&.title)enddef parent_title=(t)diff --git a/app/services/journals/create_service.rb b/app/services/journals/create_service.rbindex 9a5e9926838..63eac2d2757 100644--- a/app/services/journals/create_service.rb+++ b/app/services/journals/create_service.rb@@ -118,12 +118,6 @@ module Journals""end- timestamp = if notes.blank? && journable_timestamp- ':created_at'- else- 'now()'- end-journal_sql = <<~SQLINSERT INTOjournals (@@ -133,7 +127,8 @@ module Journalsactivity_type,user_id,notes,- created_at+ created_at,+ updated_at)SELECT:journable_id,@@ -142,7 +137,8 @@ module Journals:activity_type,:user_id,:notes,- #{timestamp}+ #{journal_timestamp_sql(notes, ':created_at')},+ #{journal_timestamp_sql(notes, ':updated_at')}FROM max_journals#{condition}RETURNING *@@ -154,7 +150,8 @@ module Journalsactivity_type: journable.activity_type,journable_type: journable_type,user_id: user.id,- created_at: journable_timestamp)+ created_at: journable_timestamp,+ updated_at: journable_timestamp)enddef insert_data_sql@@ -393,7 +390,7 @@ module Journalsenddef journable_timestamp- journable.respond_to?(:updated_at) && journable.updated_at || journable.respond_to?(:updated_on) && journable.updated_on+ journable.send(journable.class.aaj_options[:timestamp])enddef journable_type@@ -412,6 +409,14 @@ module Journals"REGEXP_REPLACE(COALESCE(#{column},''), '\\r\\n', '\n', 'g')"end+ def journal_timestamp_sql(notes, attribute)+ if notes.blank? && journable_timestamp+ attribute+ else+ 'now()'+ end+ end+# Because we added the journal via bare metal sql, rails does not yet# know of the journal. If the journable has the journals loaded already,# the caller might expect the journals to also be updated so we do it for him.diff --git a/app/services/projects/copy/forums_dependent_service.rb b/app/services/projects/copy/forums_dependent_service.rbindex e2385fad1e3..43fb3c488ae 100644--- a/app/services/projects/copy/forums_dependent_service.rb+++ b/app/services/projects/copy/forums_dependent_service.rb@@ -60,8 +60,8 @@ module Projects::Copy'author_id','replies_count','last_reply_id',- 'created_on',- 'updated_on')+ 'created_at',+ 'updated_at')new_topic.forum = new_forumnew_topic.author_id = topic.author_idnew_forum.topics << new_topicdiff --git a/app/services/projects/copy/members_dependent_service.rb b/app/services/projects/copy/members_dependent_service.rbindex 4ec3a153893..2f31f2796bf 100644--- a/app/services/projects/copy/members_dependent_service.rb+++ b/app/services/projects/copy/members_dependent_service.rb@@ -49,7 +49,7 @@ module Projects::Copynext if role_ids.empty?attributes = member- .attributes.dup.except('id', 'project_id', 'created_on')+ .attributes.dup.except('id', 'project_id', 'created_at').merge(role_ids: role_ids)target.memberships.create attributesdiff --git a/app/services/projects/copy/versions_dependent_service.rb b/app/services/projects/copy/versions_dependent_service.rbindex 13008dcabf5..0c3f560eb13 100644--- a/app/services/projects/copy/versions_dependent_service.rb+++ b/app/services/projects/copy/versions_dependent_service.rb@@ -39,7 +39,7 @@ module Projects::Copydef copy_dependency(params:)version_id_map = {}source.versions.each do |source_version|- version = target.versions.create source_version.attributes.dup.except('id', 'project_id', 'created_on', 'updated_at')+ version = target.versions.create source_version.attributes.dup.except('id', 'project_id', 'created_at', 'updated_at')version_id_map[source_version.id] = version.idenddiff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erbindex 8dca6f82a72..d35463412b0 100644--- a/app/views/forums/index.html.erb+++ b/app/views/forums/index.html.erb@@ -121,7 +121,7 @@ See docs/COPYRIGHT.rdoc for more details.<td><% if forum.last_message %><% forum.last_message %>- <%= authoring forum.last_message.created_on, forum.last_message.author %><br />+ <%= authoring forum.last_message.created_at, forum.last_message.author %><br /><%= link_to_message forum.last_message, no_root: true %><% end %></td>diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erbindex e1031134ab7..436f766ef1f 100644--- a/app/views/forums/show.html.erb+++ b/app/views/forums/show.html.erb@@ -97,9 +97,9 @@ See docs/COPYRIGHT.rdoc for more details.</div></div></th>- <%= sort_header_tag("created_on", caption: Message.human_attribute_name(:created_on)) %>+ <%= sort_header_tag("created_on", caption: Message.human_attribute_name(:created_at)) %><%= sort_header_tag("replies", caption: t(:label_reply_plural)) %>- <%= sort_header_tag("updated_on", caption: t(:label_message_last)) %>+ <%= sort_header_tag("updated_at", caption: t(:label_message_last)) %></tr></thead><tbody>@@ -119,13 +119,13 @@ See docs/COPYRIGHT.rdoc for more details.<%= link_to message.author.name, user_path(message.author) %><% end %></td>- <td class="created_on">- <%= format_time message.created_on %>+ <td class="created_at">+ <%= format_time message.created_at %></td><td class="replies"><%= message.replies_count %></td><td class="last_message"><% if message.last_reply %>- <%= authoring message.last_reply.created_on, message.last_reply.author %><br/>+ <%= authoring message.last_reply.created_at, message.last_reply.author %><br/><br/><%= link_to_message message.last_reply, no_root: true %><% end %>diff --git a/app/views/homescreen/blocks/_users.html.erb b/app/views/homescreen/blocks/_users.html.erbindex f3d93ba39c9..26f040708c1 100644--- a/app/views/homescreen/blocks/_users.html.erb+++ b/app/views/homescreen/blocks/_users.html.erb@@ -7,7 +7,7 @@<% @newest_users.each do |user| %><li><%= link_to user, user_path(user), title: user.name %>- <small>(<%= format_date(user.created_on) %>)</small>+ <small>(<%= format_date(user.created_at) %>)</small></li><% end %></ul>diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erbindex 1d9686a4896..18f591a5a07 100644--- a/app/views/messages/show.html.erb+++ b/app/views/messages/show.html.erb@@ -67,7 +67,7 @@ See docs/COPYRIGHT.rdoc for more details.<% end %><div class="forum-message">- <p class="author additional-information"><%= authoring @topic.created_on, @topic.author %></p>+ <p class="author additional-information"><%= authoring @topic.created_at, @topic.author %></p><div class="wiki"><%= format_text(@topic.content, object: @topic, attachments: @topic.attachments) %></div>@@ -108,7 +108,7 @@ See docs/COPYRIGHT.rdoc for more details.r: message,anchor: "message-#{message.id}") %>-- <%= authoring message.created_on, message.author %>+ <%= authoring message.created_at, message.author %></h4><div class="wiki"><%= format_text message, :content, attachments: message.attachments %>diff --git a/app/views/my/access_token.html.erb b/app/views/my/access_token.html.erbindex 18b58153260..b733973748f 100644--- a/app/views/my/access_token.html.erb+++ b/app/views/my/access_token.html.erb@@ -56,7 +56,7 @@ See docs/COPYRIGHT.rdoc for more details.<th><div class="generic-table--sort-header-outer"><div class="generic-table--sort-header">- <%= User.human_attribute_name(:created_on) %>+ <%= User.human_attribute_name(:created_at) %></div></div></th>@@ -82,8 +82,8 @@ See docs/COPYRIGHT.rdoc for more details.<tr><td><%= t(:label_feeds_access_key_type) %></td><td>- <span title="<%= format_time(@user.rss_token.created_on) %>">- <%= format_time(@user.rss_token.created_on.to_s) %>+ <span title="<%= format_time(@user.rss_token.created_at) %>">+ <%= format_time(@user.rss_token.created_at.to_s) %></span></td><td><%= I18n.t('my_account.access_tokens.indefinite_expiration') %></td>@@ -114,8 +114,8 @@ See docs/COPYRIGHT.rdoc for more details.<tr><td><%= t(:label_api_access_key_type) %></td><td>- <span title="<%= format_time(@user.api_token.created_on) %>">- <%= format_time(@user.api_token.created_on.to_s) %>+ <span title="<%= format_time(@user.api_token.created_at) %>">+ <%= format_time(@user.api_token.created_at.to_s) %></span></td><td><%= I18n.t('my_account.access_tokens.indefinite_expiration') %></td>diff --git a/app/views/news/show.html.erb b/app/views/news/show.html.erbindex fc81d49b55b..ceeff27f632 100644--- a/app/views/news/show.html.erb+++ b/app/views/news/show.html.erb@@ -88,7 +88,7 @@ See docs/COPYRIGHT.rdoc for more details.title: t(:button_delete),alt: t(:button_delete) %></div>- <h4 class="author additional-information"><%= avatar(comment.author) %><%= authoring comment.created_on, comment.author %></h4>+ <h4 class="author additional-information"><%= avatar(comment.author) %><%= authoring comment.created_at, comment.author %></h4><%= format_text(comment.comments, object: comment) %></div><% end %>diff --git a/app/views/wiki/annotate.html.erb b/app/views/wiki/annotate.html.erbindex f08b8648f89..8c87ab8a493 100644--- a/app/views/wiki/annotate.html.erb+++ b/app/views/wiki/annotate.html.erb@@ -47,7 +47,7 @@ See docs/COPYRIGHT.rdoc for more details.<p><%= Version.model_name.human %> <%= link_to h(@annotate.content.version), action: 'show', id: @page, version: @annotate.content.version %>- <em>(<%= h(@annotate.content.journable.author ? @annotate.content.journable.author.name : t(:label_user_anonymous)) %>, <%= format_time(@annotate.content.journable.updated_on) %>)</em>+ <em>(<%= h(@annotate.content.journable.author ? @annotate.content.journable.author.name : t(:label_user_anonymous)) %>, <%= format_time(@annotate.content.journable.updated_at) %>)</em></p><% colors = Hash.new {|k,v| k[v] = (k.size % 12) } %><table class="filecontent annotate">diff --git a/app/views/wiki/history.html.erb b/app/views/wiki/history.html.erbindex 56b43fc4203..d8eedc35614 100644--- a/app/views/wiki/history.html.erb+++ b/app/views/wiki/history.html.erb@@ -85,7 +85,7 @@ See docs/COPYRIGHT.rdoc for more details.<div class="generic-table--sort-header-outer"><div class="generic-table--sort-header"><span>- <%= Journal.human_attribute_name(:updated_on) %>+ <%= Journal.human_attribute_name(:updated_at) %></span></div></div>@@ -134,7 +134,7 @@ See docs/COPYRIGHT.rdoc for more details.<%= radio_button_tag('version_from', ver.version, (line_num==2), id: "cbto-#{line_num}") %><% end %></td>- <td class="updated_on"><%= format_time(ver.created_at) %></td>+ <td class="updated_at"><%= format_time(ver.created_at) %></td><td class="author"><%= link_to_user ver.user %></td><td class="comments"><%=h ver.notes %></td><td class="buttons"><%= link_to t(:button_annotate), action: 'annotate', id: @page, version: ver.version %></td>diff --git a/app/views/wiki/show.html.erb b/app/views/wiki/show.html.erbindex 85577837d30..fc1d2852b78 100644--- a/app/views/wiki/show.html.erb+++ b/app/views/wiki/show.html.erb@@ -124,7 +124,7 @@ See docs/COPYRIGHT.rdoc for more details.<div><%= link_to(t(:label_previous), { action: 'show', id: @page, project_id: @page.project, version: (@content.version - 1) }, class: 'button navigate-left') if @content.version > 1 %><span><%= "#{Version.model_name.human} #{@content.version}/#{@page.content.version}" %> —</span>- <span><em><%= @content.author ? link_to_user(@content.author) : t(:label_user_anonymous) %></em> — <%= format_time(@content.updated_on) %></span>+ <span><em><%= @content.author ? link_to_user(@content.author) : t(:label_user_anonymous) %></em> — <%= format_time(@content.updated_at) %></span><%= link_to(t(:label_next), { action: 'show', id: @page, project_id: @page.project, version: (@content.version + 1) }, class: 'button navigate-right') if @content.version < @page.content.version %></div><hr />diff --git a/config/constants/ar_to_api_conversions.rb b/config/constants/ar_to_api_conversions.rbindex 78d1eb4ce31..51c0598ca75 100644--- a/config/constants/ar_to_api_conversions.rb+++ b/config/constants/ar_to_api_conversions.rb@@ -37,8 +37,6 @@ module Constantsversion: 'version',done_ratio: 'percentageDone',estimated_hours: 'estimatedTime',- created_on: 'createdAt',- updated_on: 'updatedAt',remaining_hours: 'remainingTime',spent_hours: 'spentTime',subproject: 'subprojectId',diff --git a/config/initializers/activity.rb b/config/initializers/activity.rbindex da2b86224ef..501f61f31b2 100644--- a/config/initializers/activity.rb+++ b/config/initializers/activity.rb@@ -51,8 +51,8 @@ Project.register_latest_project_activity on: 'Changeset',Project.register_latest_project_activity on: 'WikiContent',chain: %w(Wiki WikiPage),- attribute: :updated_on+ attribute: :updated_atProject.register_latest_project_activity on: 'Message',chain: 'Forum',- attribute: :updated_on+ attribute: :updated_atdiff --git a/config/locales/en.yml b/config/locales/en.ymlindex 14cc6864f3d..6972002a84a 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -811,7 +811,6 @@ en:content: "Content"color: "Color"created_at: "Created on"- created_on: "Created on"custom_options: "Possible values"custom_values: "Custom fields"date: "Date"diff --git a/db/migrate/20190618115620_fix_available_languages.rb b/db/migrate/20190618115620_fix_available_languages.rbindex dae37054e4d..dba5261e00c 100644--- a/db/migrate/20190618115620_fix_available_languages.rb+++ b/db/migrate/20190618115620_fix_available_languages.rb@@ -1,5 +1,7 @@class FixAvailableLanguages < ActiveRecord::Migration[5.2]def up+ Setting.reset_column_information+Setting.available_languages = Setting.available_languages.map do |lang|if lang == 'zh''zh-CN'@@ -12,6 +14,8 @@ class FixAvailableLanguages < ActiveRecord::Migration[5.2]enddef down+ Setting.reset_column_information+Setting.available_languages = Setting.available_languages.map do |lang|if lang == 'zh-CN''zh'@@ -22,6 +26,4 @@ class FixAvailableLanguages < ActiveRecord::Migration[5.2]User.where(language: 'zh-CN').update_all(language: 'zh')end-- privateenddiff --git a/db/migrate/20201005184411_rename_timestamps.rb b/db/migrate/20201005184411_rename_timestamps.rbnew file mode 100644index 00000000000..b9090bd746f--- /dev/null+++ b/db/migrate/20201005184411_rename_timestamps.rb@@ -0,0 +1,56 @@+class RenameTimestamps < ActiveRecord::Migration[6.0]+ def change+ alter_name_and_defaults(:comments, :created_on, :created_at)+ alter_name_and_defaults(:comments, :updated_on, :updated_at)++ alter_name_and_defaults(:messages, :created_on, :created_at)+ alter_name_and_defaults(:messages, :updated_on, :updated_at)++ alter_name_and_defaults(:versions, :created_on, :created_at)+ alter_name_and_defaults(:versions, :updated_on, :updated_at)++ alter_name_and_defaults(:users, :created_on, :created_at)+ alter_name_and_defaults(:users, :updated_on, :updated_at)++ alter_name_and_defaults(:wiki_pages, :created_on, :created_at)+ alter_name_and_defaults(:wiki_redirects, :created_on, :created_at)++ alter_name_and_defaults(:tokens, :created_on, :created_at)++ alter_name_and_defaults(:settings, :updated_on, :updated_at)++ alter_name_and_defaults(:cost_queries, :created_on, :created_at)+ alter_name_and_defaults(:cost_queries, :updated_on, :updated_at)++ alter_name_and_defaults(:wiki_contents, :updated_on, :updated_at)++ add_timestamp_column(:journals, :updated_at, :created_at)++ add_timestamp_column(:roles, :created_at, 'CURRENT_TIMESTAMP')+ add_timestamp_column(:roles, :updated_at, 'CURRENT_TIMESTAMP')+ end++ private++ def alter_name_and_defaults(table, old_column_name, new_column_name)+ rename_column table, old_column_name, new_column_name++ change_column_default table, new_column_name, from: nil, to: -> { 'CURRENT_TIMESTAMP' }+ end++ def add_timestamp_column(table, column_name, from_column = nil)+ add_column table, column_name, :timestamp, default: -> { 'CURRENT_TIMESTAMP' }++ reversible do |dir|+ dir.up do+ execute <<~SQL+ UPDATE+ #{table}+ SET #{column_name} = #{from_column}+ SQL+ end+ end++ change_column_null table, column_name, true+ end+enddiff --git a/docs/api/apiv3/endpoints/documents.apib b/docs/api/apiv3/endpoints/documents.apibindex f857d594f95..17ba85485a0 100644--- a/docs/api/apiv3/endpoints/documents.apib+++ b/docs/api/apiv3/endpoints/documents.apib@@ -201,7 +201,7 @@ The documents returned depend on the provided parameters and also on the request+ sortBy (optional, string, `[["created_at", "asc"]]`) ... JSON specifying sort criteria.Accepts the same format as returned by the [queries](#queries) endpoint. Currently supported sorts are:+ id: Sort by primary key- + created_on: Sort by document creation datetime+ + created_at: Sort by document creation datetime+ Response 200 (application/hal+json)diff --git a/docs/api/apiv3/endpoints/news.apib b/docs/api/apiv3/endpoints/news.apibindex a12635cd5bb..10bbf51fff6 100644--- a/docs/api/apiv3/endpoints/news.apib+++ b/docs/api/apiv3/endpoints/news.apib@@ -188,7 +188,7 @@ Lists news. The news returned depend on the provided parameters and also on the+ sortBy (optional, string, `[["created_at", "asc"]]`) ... JSON specifying sort criteria.Accepts the same format as returned by the [queries](#queries) endpoint. Currently supported sorts are:+ id: Sort by primary key- + created_on: Sort by news creation datetime+ + created_at: Sort by news creation datetime+ filters (optional, string, `[{ "project_id": { "operator": "=", "values": ["1", "2"] } }]`) ... JSON specifying filter conditions.Accepts the same format as returned by the [queries](#queries) endpoint. Currently supported filters are:diff --git a/docs/api/apiv3/endpoints/projects.apib b/docs/api/apiv3/endpoints/projects.apibindex 8077d34f49a..f3945201857 100644--- a/docs/api/apiv3/endpoints/projects.apib+++ b/docs/api/apiv3/endpoints/projects.apib@@ -406,7 +406,7 @@ Returns a collection of projects. The collection can be filtered via query paramCurrently supported filters are:+ active: based on the active property of the project+ ancestor: filters projects by their ancestor. A project is not considered to be it's own ancestor.- + created_on: based on the time the project was created+ + created_at: based on the time the project was created+ latest_activity_at: based on the time the last activity was registered on a project.+ name_and_identifier: based on both the name and the identifier.+ parent_id: filters projects by their parent.@@ -418,7 +418,7 @@ Returns a collection of projects. The collection can be filtered via query paramCurrently supported orders are:+ id+ name- + created_on+ + created_at+ public+ latest_activity_at+ required_disk_spacediff --git a/lib/api/v3/principals/principal_representer.rb b/lib/api/v3/principals/principal_representer.rbindex 9fc0d86b81b..a41c1b10faa 100644--- a/lib/api/v3/principals/principal_representer.rb+++ b/lib/api/v3/principals/principal_representer.rb@@ -73,12 +73,10 @@ module APIproperty :name,render_nil: true- date_time_property :created_on,- as: 'createdAt',+ date_time_property :created_at,cache_if: -> { current_user_is_admin_or_self }- date_time_property :updated_on,- as: 'updatedAt',+ date_time_property :updated_at,cache_if: -> { current_user_is_admin_or_self }def current_user_is_admin_or_selfdiff --git a/lib/api/v3/versions/version_representer.rb b/lib/api/v3/versions/version_representer.rbindex f3e66170790..463085addb7 100644--- a/lib/api/v3/versions/version_representer.rb+++ b/lib/api/v3/versions/version_representer.rb@@ -104,11 +104,8 @@ module APIproperty :sharing- date_time_property :created_on,- as: 'createdAt'-- date_time_property :updated_on,- as: 'updatedAt'+ date_time_property :created_at+ date_time_property :updated_atdef _type'Version'diff --git a/lib/api/v3/work_packages/eager_loading/checksum.rb b/lib/api/v3/work_packages/eager_loading/checksum.rbindex 031d3a18a9e..bf3636de6c6 100644--- a/lib/api/v3/work_packages/eager_loading/checksum.rb+++ b/lib/api/v3/work_packages/eager_loading/checksum.rb@@ -59,9 +59,8 @@ module APIdef md5_concatmd5_parts = checksum_associations.map do |association_name|table_name = md5_checksum_table_name(association_name)- timestamp_column_name = md5_checksum_timestamp_column(association_name)- %W[#{table_name}.id #{table_name}.#{timestamp_column_name}]+ %W[#{table_name}.id #{table_name}.updated_at]end.flatten<<-SQL@@ -84,10 +83,6 @@ module APIendend- def md5_checksum_timestamp_column(association_name)- (association_class(association_name).all_timestamp_attributes_in_model & %w[updated_at updated_on]).first- end-def association_class(association_name)WorkPackage.reflect_on_association(association_name).class_name.constantizeenddiff --git a/lib/open_project/page_hierarchy_helper.rb b/lib/open_project/page_hierarchy_helper.rbindex f36a0045a6f..86fb9b8871d 100644--- a/lib/open_project/page_hierarchy_helper.rb+++ b/lib/open_project/page_hierarchy_helper.rb@@ -72,8 +72,8 @@ module OpenProjectenddef hierarchy_item_title(options, page)- if options[:timestamp] && page.updated_on- ::I18n.t(:label_updated_time, value: distance_of_time_in_words(Time.now, page.updated_on))+ if options[:timestamp] && page.updated_at+ ::I18n.t(:label_updated_time, value: distance_of_time_in_words(Time.now, page.updated_at))endenddiff --git a/lib/plugins/acts_as_journalized/lib/acts/journalized/options.rb b/lib/plugins/acts_as_journalized/lib/acts/journalized/options.rbindex 6d6c25cc382..74fc78cbd44 100644--- a/lib/plugins/acts_as_journalized/lib/acts/journalized/options.rb+++ b/lib/plugins/acts_as_journalized/lib/acts/journalized/options.rb@@ -105,6 +105,7 @@ module Acts::Journalizedclass_name: Journal.name,dependent: :destroy,foreign_key: :journable_id,+ timestamp: :updated_at,as: :journable}.merge(options.symbolize_keys)enddiff --git a/lib/plugins/acts_as_journalized/lib/journal_deprecated.rb b/lib/plugins/acts_as_journalized/lib/journal_deprecated.rbindex c0bdba935d6..39c6f2ed2d5 100644--- a/lib/plugins/acts_as_journalized/lib/journal_deprecated.rb+++ b/lib/plugins/acts_as_journalized/lib/journal_deprecated.rb@@ -50,24 +50,9 @@# It provides the hooks to apply different formatting to the details# of a specific journal.module JournalDeprecated- # Old timestamps. created_at is what t.timestamps creates in recent Rails journals- def created_on- created_at- end-- # Old naming- def journalized- journaled- end-- # Old naming- def journalized=(obj)- journaled = obj- end-# Shortcut from more issue-specific journalsdef attachments- journalized.respond_to?(:attachments) ? journalized.attachments : nil+ journaled.respond_to?(:attachments) ? journaled.attachments : nilend# deprecate created_on: "use #created_at"diff --git a/lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb b/lib/plugins/acts_as_searchable/lib/acts_as_searchable.rbindex a47df934d0b..9d0099d912e 100644--- a/lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb+++ b/lib/plugins/acts_as_searchable/lib/acts_as_searchable.rb@@ -37,8 +37,8 @@ module Redmine# Options:# * :columns - a column or an array of columns to search# * :project_key - project foreign key (default to project_id)- # * :date_column - name of the datetime column (default to created_on)- # * :sort_order - name of the column used to sort results (default to :date_column or created_on)+ # * :date_column - name of the datetime column (default to created_at)+ # * :order_column - name of the column used to sort results (default to :date_column or created_at)# * :permission - permission required to search the model (default to :view_"objects")def acts_as_searchable(options = {})return if included_modules.include?(Redmine::Acts::Searchable::InstanceMethods)@@ -55,7 +55,7 @@ module Redminesearchable_options[:tsv_columns] ||= []searchable_options[:project_key] ||= "#{table_name}.project_id"- searchable_options[:date_column] ||= "#{table_name}.created_on"+ searchable_options[:date_column] ||= "#{table_name}.created_at"searchable_options[:order_column] ||= searchable_options[:date_column]# Permission needed to search this modeldiff --git a/modules/backlogs/app/controllers/rb_master_backlogs_controller.rb b/modules/backlogs/app/controllers/rb_master_backlogs_controller.rbindex c86f949019c..9fc6da12cd2 100644--- a/modules/backlogs/app/controllers/rb_master_backlogs_controller.rb+++ b/modules/backlogs/app/controllers/rb_master_backlogs_controller.rb@@ -35,7 +35,7 @@ class RbMasterBacklogsController < RbApplicationController@owner_backlogs = Backlog.owner_backlogs(@project)@sprint_backlogs = Backlog.sprint_backlogs(@project)- @last_update = (@sprint_backlogs + @owner_backlogs).map(&:updated_on).compact.max+ @last_update = (@sprint_backlogs + @owner_backlogs).map(&:updated_at).compact.maxendprivatediff --git a/modules/backlogs/app/helpers/rb_common_helper.rb b/modules/backlogs/app/helpers/rb_common_helper.rbindex f7cddc5adde..e96df8f5186 100644--- a/modules/backlogs/app/helpers/rb_common_helper.rb+++ b/modules/backlogs/app/helpers/rb_common_helper.rb@@ -162,10 +162,6 @@ module RbCommonHelperstory.type.nil? ? '' : h(backlogs_types_by_id[story.type_id].name)end- def updated_on_with_milliseconds(story)- date_string_with_milliseconds(story.updated_on, 0.001) unless story.blank?- end-def date_string_with_milliseconds(d, add = 0)return '' if d.blank?d.strftime('%B %d, %Y %H:%M:%S') + '.' + (d.to_f % 1 + add).to_s.split('.')[1]diff --git a/modules/backlogs/app/models/backlog.rb b/modules/backlogs/app/models/backlog.rbindex b3ce588c269..0817e7fbbfd 100644--- a/modules/backlogs/app/models/backlog.rb+++ b/modules/backlogs/app/models/backlog.rb@@ -55,7 +55,7 @@ class Backlog@owner_backlog = options['owner_backlog']end- def updated_on+ def updated_at@stories.max_by(&:updated_at).try(:updated_at)enddiff --git a/modules/backlogs/app/models/sprint.rb b/modules/backlogs/app/models/sprint.rbindex a8202670f7c..a79487f0495 100644--- a/modules/backlogs/app/models/sprint.rb+++ b/modules/backlogs/app/models/sprint.rb@@ -138,7 +138,7 @@ class Sprint < Version# Assume a sprint is active if it's only 2 days oldreturn true if bd.remaining_hours.size <= 2- WorkPackage.exists?(['version_id = ? and ((updated_on between ? and ?) or (created_on between ? and ?))',+ WorkPackage.exists?(['version_id = ? and ((updated_at between ? and ?) or (created_at between ? and ?))',id, -2.days.from_now, Time.now, -2.days.from_now, Time.now])enddiff --git a/modules/backlogs/app/views/rb_tasks/index.html.erb b/modules/backlogs/app/views/rb_tasks/index.html.erbindex 77cf0645f63..9613f97aaeb 100644--- a/modules/backlogs/app/views/rb_tasks/index.html.erb+++ b/modules/backlogs/app/views/rb_tasks/index.html.erb@@ -28,7 +28,7 @@ See docs/COPYRIGHT.rdoc for more details.++#%><div>- <div class="meta" id="last_updated"><%= date_string_with_milliseconds( (@last_updated.blank? ? Time.parse(params[:after]) : @last_updated.updated_on), 0.001 ) %></div>+ <div class="meta" id="last_updated"><%= date_string_with_milliseconds( (@last_updated.blank? ? Time.parse(params[:after]) : @last_updated.updated_at), 0.001 ) %></div><%= render :partial => "task", :collection => @tasks, :locals => { :include_meta => @include_meta } %><%- if @impediments %><%= render :partial => "impediment", :collection => @impediments, :locals => { :include_meta => @include_meta }%>diff --git a/modules/budgets/config/locales/en.yml b/modules/budgets/config/locales/en.ymlindex 680f824b23c..ab49c2dfd5f 100644--- a/modules/budgets/config/locales/en.yml+++ b/modules/budgets/config/locales/en.yml@@ -35,13 +35,11 @@ en:available: "Available"budget: "Planned"budget_ratio: "Spent (ratio)"- created_on: "Created on"description: "Description"spent: "Spent"status: "Status"subject: "Subject"type: "Cost type"- updated_on: "Updated on"labor_budget: "Planned labor costs"material_budget: "Planned unit costs"work_package:diff --git a/modules/budgets/spec/lib/api/v3/budgets/budget_representer_spec.rb b/modules/budgets/spec/lib/api/v3/budgets/budget_representer_spec.rbindex 13439b55d9c..b7a9dc08659 100644--- a/modules/budgets/spec/lib/api/v3/budgets/budget_representer_spec.rb+++ b/modules/budgets/spec/lib/api/v3/budgets/budget_representer_spec.rb@@ -35,8 +35,8 @@ describe ::API::V3::Budgets::BudgetRepresenter dolet(:user) doFactoryBot.build(:user,member_in_project: project,- created_on: 1.day.ago,- updated_on: Date.today)+ created_at: 1.day.ago,+ updated_at: Date.today)endlet(:budget) doFactoryBot.create(:budget,diff --git a/modules/documents/app/controllers/documents_controller.rb b/modules/documents/app/controllers/documents_controller.rbindex eda7c0a68ad..c704ecb9c32 100644--- a/modules/documents/app/controllers/documents_controller.rb+++ b/modules/documents/app/controllers/documents_controller.rb@@ -41,7 +41,7 @@ class DocumentsController < ApplicationController@grouped =case @group_bywhen 'date'- documents.group_by {|d| d.updated_on.to_date }+ documents.group_by {|d| d.updated_at.to_date }when 'title'documents.group_by {|d| d.title.first.upcase}when 'author'diff --git a/modules/documents/app/models/document.rb b/modules/documents/app/models/document.rbindex 0eecd451376..d8196810008 100644--- a/modules/documents/app/models/document.rb+++ b/modules/documents/app/models/document.rb@@ -36,10 +36,9 @@ class Document < ApplicationRecordacts_as_journalizedacts_as_event title: Proc.new { |o| "#{Document.model_name.human}: #{o.title}" },url: Proc.new { |o| { controller: '/documents', action: 'show', id: o.id } },- datetime: :created_at,- author: ( Proc.new do |o|- o.attachments.find(:first, order: "#{Attachment.table_name}.created_at ASC").try(:author)- end)+ author: Proc.new { |o|+ o.attachments.find(:first, order: "#{Attachment.table_name}.created_at ASC").try(:author)+ }acts_as_searchable columns: ['title', "#{table_name}.description"],include: :project,@@ -72,15 +71,15 @@ class Document < ApplicationRecordself.category ||= DocumentCategory.default if new_record?end- def updated_on- unless @updated_on- # attachments has a default order that conflicts with `created_at DESC`- # #reorder removes that default order but rather than #unscoped keeps the- # scoping by this document- a = attachments.reorder(Arel.sql('created_at DESC')).first- @updated_on = (a && a.created_at) || created_at- end- @updated_on+ # TODO: This should not be necessary as the Attachments::CreateService in combination+ # with acts_as_journalized should touch the document after an attachment has been added.+ def updated_at+ @updated_at ||= [attachments.maximum(:updated_at), read_attribute(:updated_at)].compact.max+ end++ def reload(options = nil)+ @updated_at = nil+ superendprivatediff --git a/modules/documents/app/views/documents/_document.html.erb b/modules/documents/app/views/documents/_document.html.erbindex 2a217637423..22b5e649c68 100644--- a/modules/documents/app/views/documents/_document.html.erb+++ b/modules/documents/app/views/documents/_document.html.erb@@ -28,7 +28,7 @@ See docs/COPYRIGHT.rdoc for more details.++#%><h4 class="document-category-elements--header"><%= link_to h(document.title), :controller => '/documents', :action => 'show', :id => document %></h4>-<p class="document-category-elements--date"><em><%= format_time(document.updated_on) %></em></p>+<p class="document-category-elements--date"><em><%= format_time(document.updated_at) %></em></p><div class="wiki"><%= format_text(truncate_lines(document.description)) %>diff --git a/modules/documents/spec/models/document_spec.rb b/modules/documents/spec/models/document_spec.rbindex 3af173aab12..e2d7c67f370 100644--- a/modules/documents/spec/models/document_spec.rb+++ b/modules/documents/spec/models/document_spec.rb@@ -81,14 +81,19 @@ describe Document do}.to change { Document.count }.by 1end- it "with attachments should change the updated_on-date on the document to the attachment's date" do- 3.times do- FactoryBot.create(:attachment, container: valid_document)- end-- valid_document.reload- expect(valid_document.attachments.size).to eql 3- expect(valid_document.attachments.map(&:created_at).max).to eql valid_document.updated_on+ it "with attachments should change the updated_at-date on the document to the attachment's date" do+ valid_document.save++ expect {+ Attachments::CreateService+ .new(valid_document, author: admin)+ .call(uploaded_file: FactoryBot.attributes_for(:attachment)[:file], description: '')++ expect(valid_document.attachments.size).to eql 1+ }.to(change {+ valid_document.reload+ valid_document.updated_at+ })endit "without attachments, the updated-on-date is taken from the document's date" dodiff --git a/modules/ldap_groups/app/cells/ldap_groups/memberships/table_cell.rb b/modules/ldap_groups/app/cells/ldap_groups/memberships/table_cell.rbindex 6e05b854f8d..a05d37c6784 100644--- a/modules/ldap_groups/app/cells/ldap_groups/memberships/table_cell.rb+++ b/modules/ldap_groups/app/cells/ldap_groups/memberships/table_cell.rb@@ -18,7 +18,7 @@ module LdapGroupsdef headers[['user', caption: ::LdapGroups::Membership.human_attribute_name('user')],- ['added', caption: ::LdapGroups::Membership.human_attribute_name('created_on')]+ ['added', caption: ::LdapGroups::Membership.human_attribute_name('created_at')]]endenddiff --git a/modules/meeting/app/models/meeting_content.rb b/modules/meeting/app/models/meeting_content.rbindex fc8cee19f7c..2938533e674 100644--- a/modules/meeting/app/models/meeting_content.rb+++ b/modules/meeting/app/models/meeting_content.rb@@ -80,11 +80,6 @@ class MeetingContent < ApplicationRecord.first.dataend- # Compatibility for mailer.rb- def updated_on- updated_at- end-# Show the project on activity and search viewsdef projectmeeting.projectdiff --git a/modules/meeting/app/views/meeting_contents/history.html.erb b/modules/meeting/app/views/meeting_contents/history.html.erbindex 3f29964e8ef..720c10115d0 100644--- a/modules/meeting/app/views/meeting_contents/history.html.erb+++ b/modules/meeting/app/views/meeting_contents/history.html.erb@@ -70,7 +70,7 @@ See docs/COPYRIGHT.rdoc for more details.<div class="generic-table--sort-header-outer"><div class="generic-table--sort-header"><span>- <%= Meeting.human_attribute_name(:updated_on) %>+ <%= Meeting.human_attribute_name(:updated_at) %></span></div></div>diff --git a/modules/two_factor_authentication/spec/features/remember_cookie/login_with_remember_cookie_spec.rb b/modules/two_factor_authentication/spec/features/remember_cookie/login_with_remember_cookie_spec.rbindex 15e608565b9..603459f8cc4 100644--- a/modules/two_factor_authentication/spec/features/remember_cookie/login_with_remember_cookie_spec.rb+++ b/modules/two_factor_authentication/spec/features/remember_cookie/login_with_remember_cookie_spec.rb@@ -76,7 +76,7 @@ describe 'Login with 2FA remember cookie', type: :feature,# Expire tokentoken = ::TwoFactorAuthentication::RememberedAuthToken.find_by!(user: user)expect(token).not_to be_expired- token.update_columns(expires_on: 1.day.ago, created_on: 31.days.ago)+ token.update_columns(expires_on: 1.day.ago, created_at: 31.days.ago)# Log out and in againvisit '/logout'diff --git a/spec/controllers/news/comments_controller_spec.rb b/spec/controllers/news/comments_controller_spec.rbindex a8dc3442520..f68b1bad0db 100644--- a/spec/controllers/news/comments_controller_spec.rb+++ b/spec/controllers/news/comments_controller_spec.rb@@ -44,7 +44,7 @@ describe News::CommentsController, type: :controller doexpect(response).to redirect_to news_path(news)- latest_comment = news.comments.reorder(Arel.sql('created_on DESC')).first+ latest_comment = news.comments.reorder(created_at: :desc).firstexpect(latest_comment).not_to be_nilexpect(latest_comment.comments).to eq 'This is a test comment'expect(latest_comment.author).to eq userdiff --git a/spec/factories/principal_factory.rb b/spec/factories/principal_factory.rbindex b1f0da4c20a..3aaec3c173d 100644--- a/spec/factories/principal_factory.rb+++ b/spec/factories/principal_factory.rb@@ -37,8 +37,8 @@ FactoryBot.define do# necessary as we have created_on instead of created_at for which factory girl would# provide values automatically- created_on { Time.now }- updated_on { Time.now }+ created_at { Time.now }+ updated_at { Time.now }callback(:after_build) do |user, evaluator| # this is also done after :create(projects = evaluator.member_in_projects || [])diff --git a/spec/factories/version_factory.rb b/spec/factories/version_factory.rbindex 6a6b6cc59a5..ffbc5e2d207 100644--- a/spec/factories/version_factory.rb+++ b/spec/factories/version_factory.rb@@ -30,8 +30,8 @@ FactoryBot.define dofactory :version dosequence(:name) { |i| "Version #{i}" }effective_date { Date.today + 14.days }- created_on { Time.now }- updated_on { Time.now }+ created_at { Time.now }+ updated_at { Time.now }projectendenddiff --git a/spec/features/forums/sticky_spec.rb b/spec/features/forums/sticky_spec.rbindex b650e5ad737..f30b5f07566 100644--- a/spec/features/forums/sticky_spec.rb+++ b/spec/features/forums/sticky_spec.rb@@ -32,18 +32,18 @@ describe 'sticky messages', type: :feature dolet(:forum) { FactoryBot.create(:forum) }let!(:message1) do- FactoryBot.create :message, forum: forum, created_on: Time.now - 1.minute do |message|- Message.where(id: message.id).update_all(updated_on: Time.now - 1.minute)+ FactoryBot.create :message, forum: forum, created_at: Time.now - 1.minute do |message|+ Message.where(id: message.id).update_all(updated_at: Time.now - 1.minute)endendlet!(:message2) do- FactoryBot.create :message, forum: forum, created_on: Time.now - 2.minute do |message|- Message.where(id: message.id).update_all(updated_on: Time.now - 2.minute)+ FactoryBot.create :message, forum: forum, created_at: Time.now - 2.minute do |message|+ Message.where(id: message.id).update_all(updated_at: Time.now - 2.minute)endendlet!(:message3) do- FactoryBot.create :message, forum: forum, created_on: Time.now - 3.minute do |message|- Message.where(id: message.id).update_all(updated_on: Time.now - 3.minute)+ FactoryBot.create :message, forum: forum, created_at: Time.now - 3.minute do |message|+ Message.where(id: message.id).update_all(updated_at: Time.now - 3.minute)endenddiff --git a/spec/features/users/index_spec.rb b/spec/features/users/index_spec.rbindex 6048281a389..91adc36c08b 100644--- a/spec/features/users/index_spec.rb+++ b/spec/features/users/index_spec.rb@@ -29,9 +29,9 @@require 'spec_helper'describe 'index users', type: :feature do- let!(:admin) { FactoryBot.create :admin, created_on: 1.hour.ago }+ let!(:admin) { FactoryBot.create :admin, created_at: 1.hour.ago }let!(:anonymous) { FactoryBot.create :anonymous }- let!(:active_user) { FactoryBot.create :user, created_on: 1.minute.ago }+ let!(:active_user) { FactoryBot.create :user, created_at: 1.minute.ago }let!(:registered_user) { FactoryBot.create :user, status: User::STATUSES[:registered] }let!(:invited_user) { FactoryBot.create :user, status: User::STATUSES[:invited] }let(:index_page) { Pages::Admin::Users::Index.new }diff --git a/spec/lib/api/utilities/property_name_converter_spec.rb b/spec/lib/api/utilities/property_name_converter_spec.rbindex 06cfbb0eb84..3eede3c124e 100644--- a/spec/lib/api/utilities/property_name_converter_spec.rb+++ b/spec/lib/api/utilities/property_name_converter_spec.rb@@ -156,7 +156,7 @@ describe ::API::Utilities::PropertyNameConverter doendcontext 'inapropriate back-replacement' do- # should not be translated back to updated_on, which is transformed for ar->api+ # should not be translated back to updated_at, which is transformed for ar->apilet(:attribute_name) { 'updatedAt' }it 'should not be performed' do@@ -167,7 +167,7 @@ describe ::API::Utilities::PropertyNameConverter dolet(:context) { FactoryBot.build_stubbed(:version) }it 'should be performed' do- is_expected.to eql('updated_on')+ is_expected.to eql('updated_at')endendenddiff --git a/spec/lib/api/v3/categories/category_representer_spec.rb b/spec/lib/api/v3/categories/category_representer_spec.rbindex f89863f093e..36d0faa49d3 100644--- a/spec/lib/api/v3/categories/category_representer_spec.rb+++ b/spec/lib/api/v3/categories/category_representer_spec.rb@@ -124,7 +124,7 @@ describe ::API::V3::Categories::CategoryRepresenter doendit 'changes when the category\'s assigned_to is updated' do- category.assigned_to.updated_on = Time.now + 20.seconds+ category.assigned_to.updated_at = Time.now + 20.secondsexpect(representer.json_cache_key).not_to eql former_cache_keydiff --git a/spec/lib/api/v3/groups/group_representer_spec.rb b/spec/lib/api/v3/groups/group_representer_spec.rbindex 607f60539ff..15d2d71be15 100644--- a/spec/lib/api/v3/groups/group_representer_spec.rb+++ b/spec/lib/api/v3/groups/group_representer_spec.rb@@ -76,12 +76,12 @@ describe ::API::V3::Groups::GroupRepresenter doendit_behaves_like 'has UTC ISO 8601 date and time' do- let(:date) { group.created_on }+ let(:date) { group.created_at }let(:json_path) { 'createdAt' }endit_behaves_like 'has UTC ISO 8601 date and time' do- let(:date) { group.updated_on }+ let(:date) { group.updated_at }let(:json_path) { 'updatedAt' }endend@@ -128,7 +128,7 @@ describe ::API::V3::Groups::GroupRepresenter doendit 'changes when the group is updated' do- group.updated_on = Time.now + 20.seconds+ group.updated_at = Time.now + 20.secondsexpect(representer.json_cache_key).not_to eql former_cache_keydiff --git a/spec/lib/api/v3/users/paginated_user_collection_representer_spec.rb b/spec/lib/api/v3/users/paginated_user_collection_representer_spec.rbindex a046fe81845..dff5f4457c0 100644--- a/spec/lib/api/v3/users/paginated_user_collection_representer_spec.rb+++ b/spec/lib/api/v3/users/paginated_user_collection_representer_spec.rb@@ -38,9 +38,7 @@ describe ::API::V3::Users::PaginatedUserCollectionRepresenter dolet(:users) dousers = FactoryBot.build_stubbed_list(:user,- actual_count,- created_on: Time.now,- updated_on: Time.now)+ actual_count)allow(users).to receive(:per_page).with(page_size)diff --git a/spec/lib/api/v3/users/user_collection_representer_spec.rb b/spec/lib/api/v3/users/user_collection_representer_spec.rbindex 84c6cd1ad13..e64c902838d 100644--- a/spec/lib/api/v3/users/user_collection_representer_spec.rb+++ b/spec/lib/api/v3/users/user_collection_representer_spec.rb@@ -31,9 +31,7 @@ require 'spec_helper'describe ::API::V3::Users::UserCollectionRepresenter dolet(:users) {FactoryBot.build_stubbed_list(:user,- 3,- created_on: Time.now,- updated_on: Time.now)+ 3)}let(:representer) {described_class.new(users,diff --git a/spec/lib/api/v3/users/user_representer_spec.rb b/spec/lib/api/v3/users/user_representer_spec.rbindex 8d8cb722ddc..b9bd50f3b42 100644--- a/spec/lib/api/v3/users/user_representer_spec.rb+++ b/spec/lib/api/v3/users/user_representer_spec.rb@@ -93,12 +93,12 @@ describe ::API::V3::Users::UserRepresenter doendit_behaves_like 'has UTC ISO 8601 date and time' do- let(:date) { user.created_on }+ let(:date) { user.created_at }let(:json_path) { 'createdAt' }endit_behaves_like 'has UTC ISO 8601 date and time' do- let(:date) { user.updated_on }+ let(:date) { user.updated_at }let(:json_path) { 'updatedAt' }endend@@ -293,7 +293,7 @@ describe ::API::V3::Users::UserRepresenter doendit 'changes when the user is updated' do- user.updated_on = Time.now + 20.seconds+ user.updated_at = Time.now + 20.secondsexpect(representer.json_cache_key).not_to eql former_cache_keydiff --git a/spec/lib/api/v3/utilities/path_helper_spec.rb b/spec/lib/api/v3/utilities/path_helper_spec.rbindex a126509ab50..1e376be713d 100644--- a/spec/lib/api/v3/utilities/path_helper_spec.rb+++ b/spec/lib/api/v3/utilities/path_helper_spec.rb@@ -275,9 +275,9 @@ describe ::API::V3::Utilities::PathHelper doenddescribe '#query_column' do- subject { helper.query_column 'updated_on' }+ subject { helper.query_column 'updated_at' }- it_behaves_like 'api v3 path', '/queries/columns/updated_on'+ it_behaves_like 'api v3 path', '/queries/columns/updated_at'enddescribe '#query_group_by' dodiff --git a/spec/lib/api/v3/versions/version_representer_rendering_spec.rb b/spec/lib/api/v3/versions/version_representer_rendering_spec.rbindex e9c60e7400f..207567e436a 100644--- a/spec/lib/api/v3/versions/version_representer_rendering_spec.rb+++ b/spec/lib/api/v3/versions/version_representer_rendering_spec.rb@@ -188,12 +188,12 @@ describe ::API::V3::Versions::VersionRepresenter, 'rendering' doendit_behaves_like 'has UTC ISO 8601 date and time' do- let(:date) { version.created_on }+ let(:date) { version.created_at }let(:json_path) { 'createdAt' }endit_behaves_like 'has UTC ISO 8601 date and time' do- let(:date) { version.updated_on }+ let(:date) { version.updated_at }let(:json_path) { 'updatedAt' }end@@ -255,7 +255,7 @@ describe ::API::V3::Versions::VersionRepresenter, 'rendering' doendit 'changes when the version is updated' do- version.updated_on = Time.now + 20.seconds+ version.updated_at = Time.now + 20.secondsexpect(representer.json_cache_key).not_to eql former_cache_keydiff --git a/spec/lib/api/v3/work_packages/eager_loading/cache_checksum_integration_spec.rb b/spec/lib/api/v3/work_packages/eager_loading/cache_checksum_integration_spec.rbindex 48a30259c8b..94cb47681f4 100644--- a/spec/lib/api/v3/work_packages/eager_loading/cache_checksum_integration_spec.rb+++ b/spec/lib/api/v3/work_packages/eager_loading/cache_checksum_integration_spec.rb@@ -83,7 +83,7 @@ describe ::API::V3::WorkPackages::EagerLoading::Checksum doendit 'produces a different checksum on changes to the author' do- work_package.author.update_attribute(:updated_on, Time.now + 10.seconds)+ work_package.author.update_attribute(:updated_at, Time.now + 10.seconds)expect(new_checksum).not_to eql orig_checksum@@ -97,7 +97,7 @@ describe ::API::V3::WorkPackages::EagerLoading::Checksum doendit 'produces a different checksum on changes to the assigned_to' do- work_package.assigned_to.update_attribute(:updated_on, Time.now + 10.seconds)+ work_package.assigned_to.update_attribute(:updated_at, Time.now + 10.seconds)expect(new_checksum).not_to eql orig_checksum@@ -111,7 +111,7 @@ describe ::API::V3::WorkPackages::EagerLoading::Checksum doendit 'produces a different checksum on changes to the responsible' do- work_package.responsible.update_attribute(:updated_on, Time.now + 10.seconds)+ work_package.responsible.update_attribute(:updated_at, Time.now + 10.seconds)expect(new_checksum).not_to eql orig_checksum@@ -125,7 +125,7 @@ describe ::API::V3::WorkPackages::EagerLoading::Checksum doendit 'produces a different checksum on changes to the version' do- work_package.version.update_attribute(:updated_on, Time.now + 10.seconds)+ work_package.version.update_attribute(:updated_at, Time.now + 10.seconds)expect(new_checksum).not_to eql orig_checksumdiff --git a/spec/models/permitted_params_spec.rb b/spec/models/permitted_params_spec.rbindex 67871cfddbf..c3aa51fabe1 100644--- a/spec/models/permitted_params_spec.rb+++ b/spec/models/permitted_params_spec.rb@@ -921,8 +921,8 @@ describe PermittedParams, type: :model doit_behaves_like 'forbids params'end- describe 'created_on' do- let(:hash) { { 'created_on' => 'blubs' } }+ describe 'created_at' do+ let(:hash) { { 'created_at' => 'blubs' } }it_behaves_like 'forbids params'enddiff --git a/spec/models/projects/activity_spec.rb b/spec/models/projects/activity_spec.rbindex 08cf39f9042..119ce159a01 100644--- a/spec/models/projects/activity_spec.rb+++ b/spec/models/projects/activity_spec.rb@@ -132,12 +132,12 @@ describe Projects::Activity, type: :model doendit 'is the latest wiki_contents update' do- wiki_content.update_attribute(:updated_on, initial_time - 10.seconds)- wiki_content2.update_attribute(:updated_on, initial_time - 20.seconds)+ wiki_content.update_attribute(:updated_at, initial_time - 10.seconds)+ wiki_content2.update_attribute(:updated_at, initial_time - 20.seconds)wiki_content.reloadwiki_content2.reload- expect(latest_activity).to eql wiki_content.updated_on+ expect(latest_activity).to eql wiki_content.updated_atendit 'is the latest news update' do@@ -159,12 +159,12 @@ describe Projects::Activity, type: :model doendit 'is the latest message update' do- message.update_attribute(:updated_on, initial_time - 10.seconds)- message2.update_attribute(:updated_on, initial_time - 20.seconds)+ message.update_attribute(:updated_at, initial_time - 10.seconds)+ message2.update_attribute(:updated_at, initial_time - 20.seconds)message.reloadmessage2.reload- expect(latest_activity).to eql message.updated_on+ expect(latest_activity).to eql message.updated_atendit 'is the latest time_entry update' do@@ -179,10 +179,10 @@ describe Projects::Activity, type: :model doit 'takes the time stamp of the latest activity across models' dowork_package.update_attribute(:updated_at, initial_time - 10.seconds)- wiki_content.update_attribute(:updated_on, initial_time - 20.seconds)+ wiki_content.update_attribute(:updated_at, initial_time - 20.seconds)news.update_attribute(:updated_at, initial_time - 30.seconds)changeset.update_attribute(:committed_on, initial_time - 40.seconds)- message.update_attribute(:updated_on, initial_time - 50.seconds)+ message.update_attribute(:updated_at, initial_time - 50.seconds)work_package.reloadwiki_content.reload@@ -199,7 +199,7 @@ describe Projects::Activity, type: :model doexpect(latest_activity).to eql work_package.updated_at- work_package.update_attribute(:updated_at, message.updated_on - 10.seconds)+ work_package.update_attribute(:updated_at, message.updated_at - 10.seconds)# Order:# wiki_content@@ -208,9 +208,9 @@ describe Projects::Activity, type: :model do# message# work_package- expect(latest_activity).to eql wiki_content.updated_on+ expect(latest_activity).to eql wiki_content.updated_at- wiki_content.update_attribute(:updated_on, work_package.updated_at - 10.seconds)+ wiki_content.update_attribute(:updated_at, work_package.updated_at - 10.seconds)# Order:# news@@ -221,7 +221,7 @@ describe Projects::Activity, type: :model doexpect(latest_activity).to eql news.updated_at- news.update_attribute(:updated_at, wiki_content.updated_on - 10.seconds)+ news.update_attribute(:updated_at, wiki_content.updated_at - 10.seconds)# Order:# changeset@@ -241,7 +241,7 @@ describe Projects::Activity, type: :model do# news# changeset- expect(latest_activity).to eql message.updated_on+ expect(latest_activity).to eql message.updated_atendendenddiff --git a/spec/requests/api/v3/membership_resources_spec.rb b/spec/requests/api/v3/membership_resources_spec.rbindex 2eb4baacb93..c968311ab5d 100644--- a/spec/requests/api/v3/membership_resources_spec.rb+++ b/spec/requests/api/v3/membership_resources_spec.rb@@ -273,7 +273,7 @@ describe 'API v3 memberships resource', type: :request, content_type: :json doendend- context 'with the outdated created_on sort by (renamed ot created_at' do+ context 'with the outdated created_on sort by (renamed to created_at)' dolet(:path) { "#{api_v3_paths.path_for(:memberships, sort_by: [%i(created_on desc)])}&pageSize=1&offset=2" }it 'is still supported and returns a slice of the visible memberships' dodiff --git a/spec_legacy/fixtures/comments.yml b/spec_legacy/fixtures/comments.ymlindex 86f2892c76d..b4acbd31ea1 100644--- a/spec_legacy/fixtures/comments.yml+++ b/spec_legacy/fixtures/comments.yml@@ -33,14 +33,14 @@ comments_001:id: 1author_id: 1comments: my first comment- created_on: 2006-12-10 18:10:10 +01:00- updated_on: 2006-12-10 18:10:10 +01:00+ created_at: 2006-12-10 18:10:10 +01:00+ updated_at: 2006-12-10 18:10:10 +01:00comments_002:commented_type: Newscommented_id: 1id: 2author_id: 2comments: This is an other comment- created_on: 2006-12-10 18:12:10 +01:00- updated_on: 2006-12-10 18:12:10 +01:00+ created_at: 2006-12-10 18:12:10 +01:00+ updated_at: 2006-12-10 18:12:10 +01:00diff --git a/spec_legacy/fixtures/messages.yml b/spec_legacy/fixtures/messages.ymlindex 8758c2bf9d6..b49fcdd53dc 100644--- a/spec_legacy/fixtures/messages.yml+++ b/spec_legacy/fixtures/messages.yml@@ -28,8 +28,8 @@---messages_001:- created_on: 2007-05-12 17:15:32 +02:00- updated_on: 2007-05-12 17:15:32 +02:00+ created_at: 2007-05-12 17:15:32 +02:00+ updated_at: 2007-05-12 17:15:32 +02:00subject: First postid: 1replies_count: 2@@ -39,8 +39,8 @@ messages_001:parent_id:forum_id: 1messages_002:- created_on: 2007-05-12 17:18:00 +02:00- updated_on: 2007-05-12 17:18:00 +02:00+ created_at: 2007-05-12 17:18:00 +02:00+ updated_at: 2007-05-12 17:18:00 +02:00subject: First replyid: 2replies_count: 0@@ -50,8 +50,8 @@ messages_002:parent_id: 1forum_id: 1messages_003:- created_on: 2007-05-12 17:18:02 +02:00- updated_on: 2007-05-12 17:18:02 +02:00+ created_at: 2007-05-12 17:18:02 +02:00+ updated_at: 2007-05-12 17:18:02 +02:00subject: "RE: First post"id: 3replies_count: 0@@ -61,8 +61,8 @@ messages_003:parent_id: 1forum_id: 1messages_004:- created_on: 2007-08-12 17:15:32 +02:00- updated_on: 2007-08-12 17:15:32 +02:00+ created_at: 2007-08-12 17:15:32 +02:00+ updated_at: 2007-08-12 17:15:32 +02:00subject: Post 2id: 4replies_count: 2@@ -72,8 +72,8 @@ messages_004:parent_id:forum_id: 1messages_005:- created_on: <%= 3.days.ago.to_date.to_s(:db) %>- updated_on: <%= 3.days.ago.to_date.to_s(:db) %>+ created_at: <%= 3.days.ago.to_date.to_s(:db) %>+ updated_at: <%= 3.days.ago.to_date.to_s(:db) %>subject: 'RE: post 2'id: 5replies_count: 0@@ -83,8 +83,8 @@ messages_005:parent_id: 4forum_id: 1messages_006:- created_on: <%= 2.days.ago.to_date.to_s(:db) %>- updated_on: <%= 2.days.ago.to_date.to_s(:db) %>+ created_at: <%= 2.days.ago.to_date.to_s(:db) %>+ updated_at: <%= 2.days.ago.to_date.to_s(:db) %>subject: 'RE: post 2'id: 6replies_count: 0@@ -94,8 +94,8 @@ messages_006:parent_id: 4forum_id: 1messages_007:- created_on: <%= 2.days.ago.to_date.to_s(:db) %>- updated_on: <%= 2.days.ago.to_date.to_s(:db) %>+ created_at: <%= 2.days.ago.to_date.to_s(:db) %>+ updated_at: <%= 2.days.ago.to_date.to_s(:db) %>subject: 'Message on a private project'id: 7replies_count: 0diff --git a/spec_legacy/fixtures/tokens.yml b/spec_legacy/fixtures/tokens.ymlindex 04180d8af42..86ddceb0674 100644--- a/spec_legacy/fixtures/tokens.yml+++ b/spec_legacy/fixtures/tokens.yml@@ -28,13 +28,13 @@---tokens_001:- created_on: 2007-01-21 00:39:12 +01:00+ created_at: 2007-01-21 00:39:12 +01:00type: Token::Invitationid: 1value: DwMJ2yIxBNeAk26znMYzYmz5dAiIina0GFrPnGTMuser_id: 1tokens_002:- created_on: 2007-01-21 00:39:52 +01:00+ created_at: 2007-01-21 00:39:52 +01:00id: 2value: sahYSIaoYrsZUef86sTHrLISdznW6ApF36h5WSnmtype: Token::Recoverydiff --git a/spec_legacy/fixtures/users.yml b/spec_legacy/fixtures/users.ymlindex 4bc040d2229..748f4ad6ece 100644--- a/spec_legacy/fixtures/users.yml+++ b/spec_legacy/fixtures/users.yml@@ -28,11 +28,11 @@---users_004:- created_on: 2006-07-19 19:34:07 +02:00+ created_at: 2006-07-19 19:34:07 +02:00status: 1last_login_on:language: en- updated_on: 2006-07-19 19:34:07 +02:00+ updated_at: 2006-07-19 19:34:07 +02:00admin: falsemail: [email protected]lastname: Hill@@ -44,11 +44,11 @@ users_004:type: Userfirst_login: falseusers_001:- created_on: 2006-07-19 19:12:21 +02:00+ created_at: 2006-07-19 19:12:21 +02:00status: 1last_login_on: 2006-07-19 22:57:52 +02:00language: en- updated_on: 2006-07-19 22:57:52 +02:00+ updated_at: 2006-07-19 22:57:52 +02:00admin: truemail: [email protected]lastname: Admin@@ -60,11 +60,11 @@ users_001:type: Userfirst_login: falseusers_002:- created_on: 2006-07-19 19:32:09 +02:00+ created_at: 2006-07-19 19:32:09 +02:00status: 1last_login_on: 2006-07-19 22:42:15 +02:00language: en- updated_on: 2006-07-19 22:42:15 +02:00+ updated_at: 2006-07-19 22:42:15 +02:00admin: falsemail: [email protected]lastname: Smith@@ -76,11 +76,11 @@ users_002:type: Userfirst_login: falseusers_003:- created_on: 2006-07-19 19:33:19 +02:00+ created_at: 2006-07-19 19:33:19 +02:00status: 1last_login_on:language: en- updated_on: 2006-07-19 19:33:19 +02:00+ updated_at: 2006-07-19 19:33:19 +02:00admin: falsemail: [email protected]lastname: Lopper@@ -93,12 +93,12 @@ users_003:first_login: falseusers_005:id: 5- created_on: 2006-07-19 19:33:19 +02:00+ created_at: 2006-07-19 19:33:19 +02:00# Lockedstatus: 3last_login_on:language: en- updated_on: 2006-07-19 19:33:19 +02:00+ updated_at: 2006-07-19 19:33:19 +02:00admin: falsemail: [email protected]lastname: Lopper2@@ -110,11 +110,11 @@ users_005:first_login: falseusers_006:id: 6- created_on: 2006-07-19 19:33:19 +02:00+ created_at: 2006-07-19 19:33:19 +02:00status: 1last_login_on:language: ''- updated_on: 2006-07-19 19:33:19 +02:00+ updated_at: 2006-07-19 19:33:19 +02:00admin: falsemail: ''lastname: Anonymous@@ -126,11 +126,11 @@ users_006:first_login: falseusers_007:id: 7- created_on: 2006-07-19 19:33:19 +02:00+ created_at: 2006-07-19 19:33:19 +02:00status: 1last_login_on:language: ''- updated_on: 2006-07-19 19:33:19 +02:00+ updated_at: 2006-07-19 19:33:19 +02:00admin: falsemail: [email protected]lastname: One@@ -142,11 +142,11 @@ users_007:first_login: falseusers_008:id: 8- created_on: 2006-07-19 19:33:19 +02:00+ created_at: 2006-07-19 19:33:19 +02:00status: 1last_login_on:language: 'de'- updated_on: 2006-07-19 19:33:19 +02:00+ updated_at: 2006-07-19 19:33:19 +02:00admin: falsemail: [email protected]lastname: Misc@@ -158,11 +158,11 @@ users_008:first_login: falseusers_009:id: 9- created_on: 2006-07-19 19:33:19 +02:00+ created_at: 2006-07-19 19:33:19 +02:00status: 1last_login_on:language: 'de'- updated_on: 2006-07-19 19:33:19 +02:00+ updated_at: 2006-07-19 19:33:19 +02:00admin: falsemail: [email protected]lastname: Miscdiff --git a/spec_legacy/fixtures/versions.yml b/spec_legacy/fixtures/versions.ymlindex f8f06c9105b..50c92e2a737 100644--- a/spec_legacy/fixtures/versions.yml+++ b/spec_legacy/fixtures/versions.yml@@ -28,70 +28,70 @@---versions_001:- created_on: 2006-07-19 21:00:07 +02:00+ created_at: 2006-07-19 21:00:07 +02:00name: "0.1"project_id: 1- updated_on: 2006-07-19 21:00:07 +02:00+ updated_at: 2006-07-19 21:00:07 +02:00id: 1description: Betaeffective_date: 2006-07-01status: closedsharing: 'none'versions_002:- created_on: 2006-07-19 21:00:33 +02:00+ created_at: 2006-07-19 21:00:33 +02:00name: "1.0"project_id: 1- updated_on: 2006-07-19 21:00:33 +02:00+ updated_at: 2006-07-19 21:00:33 +02:00id: 2description: Stable releaseeffective_date: <%= 20.day.from_now.to_date.to_s(:db) %>status: lockedsharing: 'none'versions_003:- created_on: 2006-07-19 21:00:33 +02:00+ created_at: 2006-07-19 21:00:33 +02:00name: "2.0"project_id: 1- updated_on: 2006-07-19 21:00:33 +02:00+ updated_at: 2006-07-19 21:00:33 +02:00id: 3description: Future versioneffective_date:status: opensharing: 'none'versions_004:- created_on: 2006-07-19 21:00:33 +02:00+ created_at: 2006-07-19 21:00:33 +02:00name: "2.0"project_id: 3- updated_on: 2006-07-19 21:00:33 +02:00+ updated_at: 2006-07-19 21:00:33 +02:00id: 4description: Future version on subprojecteffective_date:status: opensharing: 'tree'versions_005:- created_on: 2006-07-19 21:00:07 +02:00+ created_at: 2006-07-19 21:00:07 +02:00name: "Alpha"project_id: 2- updated_on: 2006-07-19 21:00:07 +02:00+ updated_at: 2006-07-19 21:00:07 +02:00id: 5description: Private Alphaeffective_date: 2006-07-01status: opensharing: 'none'versions_006:- created_on: 2006-07-19 21:00:07 +02:00+ created_at: 2006-07-19 21:00:07 +02:00name: "Private Version of public subproject"project_id: 5- updated_on: 2006-07-19 21:00:07 +02:00+ updated_at: 2006-07-19 21:00:07 +02:00id: 6description: "Should be done any day now..."effective_date:status: opensharing: 'tree'versions_007:- created_on: 2006-07-19 21:00:07 +02:00+ created_at: 2006-07-19 21:00:07 +02:00name: "Systemwide visible version"project_id: 2- updated_on: 2006-07-19 21:00:07 +02:00+ updated_at: 2006-07-19 21:00:07 +02:00id: 7description:effective_date:diff --git a/spec_legacy/fixtures/wiki_contents.yml b/spec_legacy/fixtures/wiki_contents.ymlindex 15821df4f84..c3b380db548 100644--- a/spec_legacy/fixtures/wiki_contents.yml+++ b/spec_legacy/fixtures/wiki_contents.yml@@ -32,7 +32,7 @@ wiki_contents_001:h1. CookBook documentationSome updated [[documentation]] here with gzipped history- updated_on: 2007-03-07 00:10:51 +01:00+ updated_at: 2007-03-07 00:10:51 +01:00page_id: 1id: 1lock_version: 3@@ -44,7 +44,7 @@ wiki_contents_002:This is a link to a ticket: #2And this is an included page:{{include(Page with an inline image)}}- updated_on: 2007-03-08 00:18:07 +01:00+ updated_at: 2007-03-08 00:18:07 +01:00page_id: 2id: 2lock_version: 1@@ -54,7 +54,7 @@ wiki_contents_003:h1. Start pageE-commerce web site start page- updated_on: 2007-03-08 00:18:07 +01:00+ updated_at: 2007-03-08 00:18:07 +01:00page_id: 3id: 3lock_version: 1@@ -66,7 +66,7 @@ wiki_contents_004:This is an inline image:!logo.gif!- updated_on: 2007-03-08 00:18:07 +01:00+ updated_at: 2007-03-08 00:18:07 +01:00page_id: 4id: 4lock_version: 1@@ -76,7 +76,7 @@ wiki_contents_005:h1. Child page 1This is a child page- updated_on: 2007-03-08 00:18:07 +01:00+ updated_at: 2007-03-08 00:18:07 +01:00page_id: 5id: 5lock_version: 1@@ -86,35 +86,35 @@ wiki_contents_006:h1. Child page 2This is a child page- updated_on: 2007-03-08 00:18:07 +01:00+ updated_at: 2007-03-08 00:18:07 +01:00page_id: 6id: 6lock_version: 1author_id: 1wiki_contents_007:text: This is a child page- updated_on: 2007-03-08 00:18:07 +01:00+ updated_at: 2007-03-08 00:18:07 +01:00page_id: 7id: 7lock_version: 1author_id: 1wiki_contents_008:text: This is a parent page- updated_on: 2007-03-08 00:18:07 +01:00+ updated_at: 2007-03-08 00:18:07 +01:00page_id: 8id: 8lock_version: 1author_id: 1wiki_contents_009:text: This is a child page- updated_on: 2007-03-08 00:18:07 +01:00+ updated_at: 2007-03-08 00:18:07 +01:00page_id: 9id: 9lock_version: 1author_id: 1wiki_contents_010:text: Page with cyrillic title- updated_on: 2007-03-08 00:18:07 +01:00+ updated_at: 2007-03-08 00:18:07 +01:00page_id: 10id: 10lock_version: 1diff --git a/spec_legacy/fixtures/wiki_pages.yml b/spec_legacy/fixtures/wiki_pages.ymlindex 261763f6023..4a33ea39846 100644--- a/spec_legacy/fixtures/wiki_pages.yml+++ b/spec_legacy/fixtures/wiki_pages.yml@@ -28,7 +28,7 @@---wiki_pages_001:- created_on: 2007-03-07 00:08:07 +01:00+ created_at: 2007-03-07 00:08:07 +01:00title: CookBook documentationslug: cookbook-documentationid: 1@@ -36,7 +36,7 @@ wiki_pages_001:protected: trueparent_id:wiki_pages_002:- created_on: 2007-03-08 00:18:07 +01:00+ created_at: 2007-03-08 00:18:07 +01:00title: Another pageslug: another-pageid: 2@@ -44,7 +44,7 @@ wiki_pages_002:protected: falseparent_id:wiki_pages_003:- created_on: 2007-03-08 00:18:07 +01:00+ created_at: 2007-03-08 00:18:07 +01:00title: Start pageslug: start-pageid: 3@@ -52,7 +52,7 @@ wiki_pages_003:protected: falseparent_id:wiki_pages_004:- created_on: 2007-03-08 00:18:07 +01:00+ created_at: 2007-03-08 00:18:07 +01:00title: Page with an inline imageslug: page-with-an-inline-imageid: 4@@ -60,7 +60,7 @@ wiki_pages_004:protected: falseparent_id: 1wiki_pages_005:- created_on: 2007-03-08 00:18:07 +01:00+ created_at: 2007-03-08 00:18:07 +01:00title: Child 1slug: child-1id: 5@@ -68,7 +68,7 @@ wiki_pages_005:protected: falseparent_id: 2wiki_pages_006:- created_on: 2007-03-08 00:18:07 +01:00+ created_at: 2007-03-08 00:18:07 +01:00title: Child 2slug: child-2id: 6@@ -76,7 +76,7 @@ wiki_pages_006:protected: falseparent_id: 2wiki_pages_007:- created_on: 2007-03-08 00:18:07 +01:00+ created_at: 2007-03-08 00:18:07 +01:00title: Child page 1slug: child-page-1id: 7@@ -84,7 +84,7 @@ wiki_pages_007:protected: falseparent_id: 8wiki_pages_008:- created_on: 2007-03-08 00:18:07 +01:00+ created_at: 2007-03-08 00:18:07 +01:00title: Parent pageslug: parent-pageid: 8@@ -92,7 +92,7 @@ wiki_pages_008:protected: falseparent_id:wiki_pages_009:- created_on: 2007-03-08 00:18:07 +01:00+ created_at: 2007-03-08 00:18:07 +01:00title: Child page 2slug: child-page-2id: 9@@ -100,7 +100,7 @@ wiki_pages_009:protected: falseparent_id: 8wiki_pages_010:- created_on: 2007-03-08 00:18:07 +01:00+ created_at: 2007-03-08 00:18:07 +01:00title: Этика менеджментаslug: etika-mieniedzhmientaid: 10diff --git a/spec_legacy/functional/wiki_controller_spec.rb b/spec_legacy/functional/wiki_controller_spec.rbindex ad532f339a7..366bf9567be 100644--- a/spec_legacy/functional/wiki_controller_spec.rb+++ b/spec_legacy/functional/wiki_controller_spec.rb@@ -148,12 +148,11 @@ describe WikiController, type: :controller do# because running whole suite is fine, but running only this test# results in failureit 'should update stale page should not raise an error' do- ::JournalVersion.create!(journable_type: 'WikiContent', journable_id: 2, version: 1)- journal = FactoryBot.create :wiki_content_journal,- journable_id: 2,- version: 1,- data: FactoryBot.build(:journal_wiki_content_journal,- text: "h1. Another page\n\n\nthis is a link to ticket: #2")+ FactoryBot.create :wiki_content_journal,+ journable_id: 2,+ version: 1,+ data: FactoryBot.build(:journal_wiki_content_journal,+ text: "h1. Another page\n\n\nthis is a link to ticket: #2")session[:user_id] = 2c = Wiki.find(1).find_page('Another page').contentc.text = 'Previous text'@@ -354,7 +353,7 @@ describe WikiController, type: :controller dopages = assigns(:pages)refute_nil pagesassert_equal wiki.pages.size, pages.size- assert_equal pages.first.content.updated_on, pages.first.updated_on+ assert_equal pages.first.content.updated_at, pages.first.updated_atassert_select 'ul', attributes: { class: 'pages-hierarchy' },child: { tag: 'li', child: { tag: 'a', attributes: { href: '/projects/ecookbook/wiki/CookBook%20documentation' },diff --git a/spec_legacy/unit/mail_handler_spec.rb b/spec_legacy/unit/mail_handler_spec.rbindex 99559a0a82e..ee4e756c738 100644--- a/spec_legacy/unit/mail_handler_spec.rb+++ b/spec_legacy/unit/mail_handler_spec.rb@@ -304,7 +304,6 @@ describe MailHandler, type: :model dospecify 'reply to issue update (Journal) by message_id' doJournal.delete_allFactoryBot.create :work_package_journal, id: 3, version: 1, journable_id: 2- JournalVersion.create(journable_type: 'WorkPackage', journable_id: 2, version: 1)journal = submit_email('ticket_reply_by_message_id.eml')assert journal.data.is_a?(Journal::WorkPackageJournal), "Email was a #{journal.data.class}"assert_equal User.find_by_login('jsmith'), journal.userdiff --git a/spec_legacy/unit/wiki_page_spec.rb b/spec_legacy/unit/wiki_page_spec.rbindex 6e95c3971f4..a3d8840a81f 100644--- a/spec_legacy/unit/wiki_page_spec.rb+++ b/spec_legacy/unit/wiki_page_spec.rb@@ -128,9 +128,9 @@ describe WikiPage, type: :model doendit 'should updated on eager load' do- page = WikiPage.with_updated_on.first+ page = WikiPage.with_updated_at.firstassert page.is_a?(WikiPage)- refute_nil page.read_attribute(:updated_on)- assert_equal page.content.updated_on, page.updated_on+ refute_nil page.read_attribute(:updated_at)+ assert_equal page.content.updated_at, page.updated_atendend