Hi All!

It's been a long time, but I'm back :-D.

I am currently working on a Single Page App using Rails 5 in api mode. I don't need a lot of the Hobo goodies (e.g. dryml), but I really would like to use Hobo Fields in my models.

Unfortunately, when I include gem 'hobo_fields' in Gemfile, my rspec tests all fail with undefined constants. HashSerializer, ObjectSerializer and BasicObjectSerializer are all missing (hidden?). I was able to implement HashSerializer and ObjectSerializer myself, but ObjectSerializer brought in BasicObjectSerializer and I couldn't find an appropriate interface for it.

The error tracebacks all showed that hobo_support was at the top of the stack as in:

     Failure/Error: render json: { errors: user.errors }, status: 422

     NameError:
       uninitialized constant BasicObjectSerializer
# /home/donz/.rvm/gems/ruby-2.3.0@authTemplate/gems/hobo_support-2.2.0/lib/hobo_support/string.rb:23:in `class_eval' # /home/donz/.rvm/gems/ruby-2.3.0@authTemplate/gems/hobo_support-2.2.0/lib/hobo_support/string.rb:23:in `class_eval' # /home/donz/.rvm/gems/ruby-2.3.0@authTemplate/gems/hobo_support-2.2.0/lib/hobo_support/string.rb:23:in `safe_constantize' # /home/donz/.rvm/gems/ruby-2.3.0@authTemplate/gems/active_model_serializers-0.10.2/lib/active_model/serializer.rb:91:in `map'

I removed hobo_fields from my gemfile and all of the tests passed.

Just in case it may be significant, the failures were all associated with the errors field of the failing model objects. The models themselves serialized fine.

One of the failing lines is:

      render json: { errors: user.errors }, status: 422

Are there any suggested fixes for this?

Thanks,

Don Ziesig


--
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to hobousers+unsubscr...@googlegroups.com.
To post to this group, send email to hobousers@googlegroups.com.
Visit this group at https://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to