app/models/kithe/model.rb in kithe-2.15.0 vs app/models/kithe/model.rb in kithe-2.15.1
- old
+ new
@@ -21,10 +21,16 @@
# * Kithe::Model.where(kithe_model_type: ["work", "asset"])
# * Kithe::Model.collection.where(title: "whatever")
#
# Since the rails enum uses an int field, this doens't take up too much extra
# space in pg or anything, and is convenient.
- enum kithe_model_type: { collection: 0, work: 1, asset: 2}
+ #
+ # Start using new non-deprecated args in Rails 7.0
+ if Rails.gem_version < Gem::Version.new("7.0")
+ enum kithe_model_type: { collection: 0, work: 1, asset: 2}
+ else
+ enum :kithe_model_type, { collection: 0, work: 1, asset: 2}
+ end
attr_json_config(default_accepts_nested_attributes: { reject_if: :all_blank })
# keep json_attributes column out of #inspect display of model shown in logs and
# console -- because it can be huge, and is generally duplicated by individual