mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Renaming Error to NoSerializerError
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
module ActiveModel
|
||||
class Serializer
|
||||
class ArraySerializer
|
||||
Error = Class.new(StandardError)
|
||||
NoSerializerError = Class.new(StandardError)
|
||||
include Enumerable
|
||||
delegate :each, to: :@objects
|
||||
|
||||
attr_reader :meta, :meta_key, :objects
|
||||
attr_reader :meta, :meta_key
|
||||
|
||||
def initialize(objects, options = {})
|
||||
@resource = objects
|
||||
@@ -16,7 +16,7 @@ module ActiveModel
|
||||
)
|
||||
|
||||
if serializer_class.nil?
|
||||
fail Error, "No serializer found for object: #{object.inspect}"
|
||||
fail NoSerializerError, "No serializer found for object: #{object.inspect}"
|
||||
else
|
||||
serializer_class.new(object, options.except(:serializer))
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user