We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Considering this example:
class Parent include Surrealist json_schema do { name: String } end def name 'Parent' end end class Child < Parent def name 'Child' end end
If we surrealize Parent, everything is fine: Parent.new.surrealize # => '{ "name": "Parent" }' But if we surrealize Child, error is thrown:
Parent
Parent.new.surrealize # => '{ "name": "Parent" }'
Child
Child.new.surrealize # => Surrealist::UnknownSchemaError: Can't serialize Child - no schema was provided.
I guess it would be useful to have a class method that would delegate surrealization to specified class, something like:
class Child < Parent delegate_surrealization_to Parent def name 'Child' end end Child.new.surrealize # => '{ "name": "Child" }'
The text was updated successfully, but these errors were encountered:
I will take a look at this
Sorry, something went wrong.
@AlessandroMinali alright, thanks!
No branches or pull requests
Considering this example:
If we surrealize
Parent
, everything is fine:Parent.new.surrealize # => '{ "name": "Parent" }'
But if we surrealize
Child
, error is thrown:I guess it would be useful to have a class method that would delegate surrealization to specified class, something like:
The text was updated successfully, but these errors were encountered: