Method: Chronicle::Models.schema_type
- Defined in:
- lib/chronicle/models/base.rb
permalink .schema_type(types) ⇒ Object
[View source]
86 87 88 89 90 91 92 93 94 |
# File 'lib/chronicle/models/base.rb', line 86 def self.schema_type(types) Chronicle::Schema::Types::Instance(Chronicle::Models::Base).constructor do |input| unless input.type_id && [types].flatten.include?(input.type_id) raise Dry::Types::ConstraintError.new(:type?, input) end input end end |