In some cases it would be useful to define metadata for options while initializing.
For example we can use SmartInitializer for describing relational database tables:
class Model
include SmartCore::Initializer
def self.column(...)
option(...)
end
end
class Author < Model
column :id, Types::Integer, metadata: { primary_key: true }
column :name, Types::String, metadata: { unique: true }
end
class Book < Model
column :author, Types::Integer, metadata: { foreign_key: Author }
column :title, Types::String
end
class CoveredBook < Book
column :cover, Types::Base64Image
end
In that case some static metadata that can be inherited would be very useful.
In some cases it would be useful to define metadata for options while initializing.
For example we can use
SmartInitializerfor describing relational database tables:In that case some static metadata that can be inherited would be very useful.