-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined method `deconstantize' for nil:NilClass #70
Comments
Here is my module Nsi
class API < Grape::API
format :json
formatter :json, Grape::Formatter::ActiveModelSerializers
mount Nsi::DictionaryResource
mount Nsi::ParameterResource
mount Nsi::DictionaryParameterResource
add_swagger_documentation :format => :json,
:hide_documentation_path => true,
:mount_path => 'swagger_doc'
end
end |
same error without option
|
Looks like i have got anonymous class hm... I already have got it there... module Grape
module Formatter
module ActiveModelSerializers
class << self
def call(resource, env)
# !!!! resource.class.name => nil, resource.class => #<Class:0x005...>
options = build_options(resource, env)
serializer = fetch_serializer(resource, options)
if serializer
::ActiveModelSerializers::Adapter.create(
serializer, options
).to_json
else
Grape::Formatter::Json.call(resource, env)
end
end
def build_options(resource, env)
Grape::ActiveModelSerializers::OptionsBuilder.new(
resource, env
).options
end
def fetch_serializer(resource, options)
Grape::ActiveModelSerializers::SerializerResolver.new(
resource, options
).serializer
end
end
end
end
end hm... I need help guys :(' What I'm doing wrong? |
Hi @ivan-garanin, is there a project that I would be able to reproduce this error in? If I can replicate the error, I can look into patching it |
Hi @drn , I'll publish on github my cutted project for you tomorrow. |
@drn, I made example app(with all same configs/settings and so on) https://github.com/ivan-garanin/example-for-grape_active_model_serializer check readme to launch it faster |
Thanks for providing that project, @ivan-garanin I dug into our source code via your project and it looks like neither this gem or That said, I implemented some basic support for sequel that you can try out. I tested this against your project:
Let me know if it works for you! |
@drn thank you! |
👍 worked? ill get that merged in over the next few days and release a new gem version |
yea, everything is OK, ty for help, ping me when release ll be ready and I'd remove that ugly line from Gemfile) |
v1.5.1 has been released! |
Hello,
Im using Grape, sequel, rake and grape-active_model_serializers( no rails ) for my little application.
Here is code of problem place
When im trying to take list of dictionaries im taking such error
Here is backtrace
All other routes(get(id), patch, all other) which are working with single record(not array) are fine.
Could you help me with this issue?
The text was updated successfully, but these errors were encountered: