You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I defined several serializers for one object.
Then I moved shared methods to a module and they aren't called.
Methods from the model are called instead.
class Person < ApplicationRecord
attr_accessor :name, :lastname
end
class PersonSerializer < Surrealist::Serializer
include PersonMethods
alias person object
json_schema { { name: String } }
# def name
# "#{person.name} #{person.lastname}"
# end
end
module PersonMethods
def name
"#{person.name} #{person.lastname}
end
end
I defined several serializers for one object.
Then I moved shared methods to a module and they aren't called.
Methods from the model are called instead.
The text was updated successfully, but these errors were encountered: