projectblacklight / spotlight

Spotlight enables librarians, curators, and others who are responsible for digital collections to create attractive, feature-rich websites that highlight these collections.
Other
157 stars 64 forks source link

Call to 'serialize' is missing keyword 'coder:' #3001

Closed jcoyne closed 5 months ago

jcoyne commented 5 months ago
missing keyword: :coder If no default coder is configured, a coder must be provided to `serialize`.
/Users/jcoyne85/workspace/projectblacklight/spotlight/app/models/spotlight/contact.rb:10:in `<class:Contact>'
/Users/jcoyne85/workspace/projectblacklight/spotlight/app/models/spotlight/contact.rb:6:in `<module:Spotlight>'
/Users/jcoyne85/workspace/projectblacklight/spotlight/app/models/spotlight/contact.rb:3:in `<top (required)>'
<internal:/Users/jcoyne85/.rbenv/versions/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
<internal:/Users/jcoyne85/.rbenv/versions/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
/Users/jcoyne85/workspace/projectblacklight/spotlight/.internal_test_app/db/migrate/20240110210152_change_contact_details.spotlight.rb:6:in `up'

Caused by:
ArgumentError: missing keyword: :coder If no default coder is configured, a coder must be provided to `serialize`. (ArgumentError)

            raise ArgumentError, <<~MSG.squish
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/Users/jcoyne85/workspace/projectblacklight/spotlight/app/models/spotlight/contact.rb:10:in `<class:Contact>'
/Users/jcoyne85/workspace/projectblacklight/spotlight/app/models/spotlight/contact.rb:6:in `<module:Spotlight>'
/Users/jcoyne85/workspace/projectblacklight/spotlight/app/models/spotlight/contact.rb:3:in `<top (required)>'

See https://github.com/rails/rails/blob/c66b655bf8948622722c24e6455b9b41febbe3a6/activerecord/lib/active_record/attribute_methods/serialization.rb#L184-L213

whisere commented 5 months ago

coder: YAML also needs to be added to files: app/models/spotlight/contact.rb exhibit.rb solr_document_sidecar.rb custom_field.rb for the 'SKIP_TRANSLATION=1 rake db:migrate' to run

whisere commented 5 months ago

also needs to be added to files: app/models/spotlight/blacklight_configuration.rb resource.rb custom_search_field.rb for localhost:3000 to run successfully.

jcoyne commented 5 months ago

@whisere Thank you for pointing that out. Would you be willing to put together a pull request with those changes?

whisere commented 5 months ago

No problem I have create the pull request: https://github.com/projectblacklight/spotlight/pull/3009