Compare commits

...

3 Commits

Author SHA1 Message Date
Christophe Bliard d21b54c41e
Set ActiveSupport.to_time_preserves_timezone = true 2 years ago
Christophe Bliard 3b7f6242a9
Set config.active_record.belongs_to_required_by_default = true 2 years ago
Christophe Bliard 6240663c74
Make ActiveRecord models inherit from ApplicationRecord 2 years ago
  1. 2
      app/models/projects/status.rb
  2. 4
      config/initializers/new_framework_defaults_5_0.rb
  3. 2
      lib/open_project/text_formatting/formats/markdown/textile_converter.rb
  4. 2
      lib/tasks/attachment_migrations.rake
  5. 2
      lib/tasks/delete_documents.rake
  6. 2
      modules/bim/app/models/bim/bcf/comment.rb
  7. 2
      modules/bim/app/models/bim/bcf/issue.rb
  8. 2
      modules/bim/app/models/bim/bcf/viewpoint.rb
  9. 2
      modules/bim/app/models/bim/ifc_models/ifc_model.rb
  10. 2
      modules/costs/app/models/time_entry_activities_project.rb
  11. 2
      modules/grids/app/models/grids/grid.rb
  12. 2
      modules/grids/app/models/grids/widget.rb
  13. 2
      modules/overviews/db/migrate/20190826083604_my_project_page_to_grid.rb

@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
class Projects::Status < ActiveRecord::Base
class Projects::Status < ApplicationRecord
belongs_to :project
self.table_name = 'project_statuses'

@ -22,12 +22,12 @@
# https://guides.rubyonrails.org/configuring.html#activesupport-to-time-preserves-timezone
# Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
# Previous versions had false. Rails 5.0+ default is true.
# ActiveSupport.to_time_preserves_timezone = true
ActiveSupport.to_time_preserves_timezone = true
# https://guides.rubyonrails.org/configuring.html#config-active-record-belongs-to-required-by-default
# Require `belongs_to` associations by default. Previous versions had false.
# Rails 5.0+ default is true.
# Rails.application.config.active_record.belongs_to_required_by_default = true
Rails.application.config.active_record.belongs_to_required_by_default = true
# https://guides.rubyonrails.org/configuring.html#config-ssl-options
# Configure SSL options to enable HSTS with subdomains. Previous versions had

@ -510,7 +510,7 @@ module OpenProject::TextFormatting::Formats
end
end
class OldForum < ::ActiveRecord::Base
class OldForum < ApplicationRecord
self.table_name = 'boards'
end
end

@ -36,6 +36,7 @@ module Migrations
# We create a separate classes as this is most likely to be used during
# the migration of an ChiliProject (2.x or 3.x) which lacks a couple
# of columns models have in OpenProject >6.
# rubocop:disable Rails/ApplicationRecord
module Attachments
class CurrentWikiPage < ::ActiveRecord::Base
self.table_name = "wiki_pages"
@ -47,6 +48,7 @@ module Migrations
self.table_name = "wiki_contents"
end
end
# rubocop:enable Rails/ApplicationRecord
end
namespace :migrations do

@ -32,10 +32,12 @@ namespace :migrations do
namespace :documents do
include Tasks::Shared::UserFeedback
# rubocop:disable Rails/ApplicationRecord
class TemporaryDocument < ActiveRecord::Base
belongs_to :project
belongs_to :category, class_name: 'DocumentCategory'
end
# rubocop:enable Rails/ApplicationRecord
desc 'Removes all documents'
task delete: :environment do |_task|

@ -27,7 +27,7 @@
#++
module Bim::Bcf
class Comment < ActiveRecord::Base
class Comment < ApplicationRecord
self.table_name = :bcf_comments
include InitializeWithUuid

@ -1,5 +1,5 @@
module Bim::Bcf
class Issue < ActiveRecord::Base
class Issue < ApplicationRecord
self.table_name = :bcf_issues
include InitializeWithUuid

@ -27,7 +27,7 @@
#++
module Bim::Bcf
class Viewpoint < ActiveRecord::Base
class Viewpoint < ApplicationRecord
self.table_name = :bcf_viewpoints
include InitializeWithUuid

@ -1,6 +1,6 @@
module Bim
module IfcModels
class IfcModel < ActiveRecord::Base
class IfcModel < ApplicationRecord
enum conversion_status: {
pending: 0,
processing: 1,

@ -26,7 +26,7 @@
# See COPYRIGHT and LICENSE files for more details.
#++
class TimeEntryActivitiesProject < ActiveRecord::Base
class TimeEntryActivitiesProject < ApplicationRecord
belongs_to :project
belongs_to :activity, class_name: 'TimeEntryActivity'
end

@ -27,7 +27,7 @@
#++
module Grids
class Grid < ActiveRecord::Base
class Grid < ApplicationRecord
self.table_name = :grids
serialize :options, Hash

@ -27,7 +27,7 @@
#++
module Grids
class Widget < ActiveRecord::Base
class Widget < ApplicationRecord
self.table_name = :grid_widgets
belongs_to :grid

@ -1,4 +1,5 @@
class MyProjectPageToGrid < ActiveRecord::Migration[5.2]
# rubocop:disable Rails/ApplicationRecord
class MyPageEntry < ActiveRecord::Base
self.table_name = 'my_projects_overviews'
@ -8,6 +9,7 @@ class MyProjectPageToGrid < ActiveRecord::Migration[5.2]
belongs_to :project
end
# rubocop:enable Rails/ApplicationRecord
def up
return unless applicable?

Loading…
Cancel
Save