Skip to content

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

Fix attribute definition

Oliver Günther21e1c5353dfa
diff --git a/app/models/concerns/tableless.rb b/app/models/concerns/tableless.rb
index 7861b206d66..cb99c40d3ac 100644
--- a/app/models/concerns/tableless.rb
+++ b/app/models/concerns/tableless.rb
@@ -42,15 +42,15 @@ module Tableless
@columns_hash ||= Hash.new
# From active_record/attributes.rb
- attributes_to_define_after_schema_loads.each do |name, (type, options)|
+ attributes_to_define_after_schema_loads.each do |name, (type, default)|
if type.is_a?(Symbol)
- type = ActiveRecord::Type.lookup(type, **options.except(:default))
+ type = ActiveRecord::Type.lookup(type, default)
end
- define_attribute(name, type, **options.slice(:default))
+ define_attribute(name, type, default: default)
# Improve Model#inspect output
- @columns_hash[name.to_s] = ActiveRecord::ConnectionAdapters::Column.new(name.to_s, options[:default])
+ @columns_hash[name.to_s] = ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default)
end
end
end