I am getting the following error:
NoMethodError - undefined method `read_attribute_for_serialization' for #Array:0x007fd3e1151898
Ruby code in controller:
@results = Record.search(size: 8, query: { match: { name: { query: params[:name], operator: 'and' } } })
@records = @results.records.records << Record.last(5)
respond_with(@records, each_serializer: RecordSerializer)
Use ArraySerializer as
ActiveModel::ArraySerializer.new(@records, each_serializer: RecordSerializer).to_json
@prasadsurase that used to be the case in 0.9.3. I'm trying to upgrade to 0.10.0.rc1 and finding that ActiveModel::ArraySerializer doesn't exist anymore…
Looks like it moved to ActiveModel::Serializer::ArraySerializer.
I fixed the problem, thanks :).
Tks everyone :smile: you're awesome
It's hard to follow up ever thread :stuck_out_tongue_closed_eyes:
Most helpful comment
Looks like it moved to ActiveModel::Serializer::ArraySerializer.