Deprecate `DB.mapping` (#196)

This commit is contained in:
Johannes Müller 2023-11-13 17:44:39 +01:00 committed by GitHub
parent 340b6e4b9a
commit 76d8bb6a6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -1,5 +1,6 @@
module DB
# Empty module used for marking a class as supporting DB:Mapping
@[Deprecated("Use `DB::Serializable` instead")]
module Mappable; end
# The `DB.mapping` macro defines how an object is built from a `ResultSet`.
@ -57,6 +58,7 @@ module DB
# it and initializes this type's instance variables.
#
# This macro also declares instance variables of the types given in the mapping.
@[Deprecated("Use `DB::Serializable` instead")]
macro mapping(properties, strict = true)
include ::DB::Mappable
@ -148,6 +150,7 @@ module DB
end
end
@[Deprecated("Use `DB::Serializable` instead")]
macro mapping(**properties)
::DB.mapping({{properties}})
end