0

Following is my model which has a field with type array

class User::Log::Presentation
  include Mongoid::Document
  include Mongoid::Timestamps

  field :name, type: String
  field :fields, type: Array, default: []
end

When I try creating a document, it throws following error.

TypeError: no implicit conversion of String into Integer

I am totally lost with this. Couldnt find any answer is other questions. Please help.

Rajdeep Singh
  • 17,621
  • 6
  • 53
  • 78
gak4u
  • 80
  • 1
  • 6

1 Answers1

1

I did the following change and started working.

field :fields, type: Array, default: []

to

field :columns, type: Array, default: []
gak4u
  • 80
  • 1
  • 6