-
Notifications
You must be signed in to change notification settings - Fork 6
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 render
for class: JSONAPI::Serializable::Render
#13
Comments
@mihaimuntenas Thanks for reporting this – it should be fixed by using master ( |
Hi, i have still the same issue. Could you fix that please so i can remove my monkey patch. Thanks |
@beauby /home/armin/.devel/essence/essence_backend/lib/essence_backend/serializers/serializable_dwh_fiscal_year.rb:3:in `<class:SerializableFrFilter>': undefined method `key_format' for SerializableFrFilter:Class (NoMethodError)
from /home/armin/.devel/essence/essence_backend/lib/essence_backend/serializers/serializable_dwh_fiscal_year.rb:1:in `<top (required)>'
from /home/armin/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/hanami-utils-1.1.1/lib/hanami/utils.rb:52:in `require_relative'
from /home/armin/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/hanami-utils-1.1.1/lib/hanami/utils.rb:52:in `block in require!'
from /home/armin/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/hanami-utils-1.1.1/lib/hanami/utils.rb:90:in `each'
from /home/armin/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/hanami-utils-1.1.1/lib/hanami/utils.rb:90:in `for_each_file_in'
from /home/armin/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/hanami-utils-1.1.1/lib/hanami/utils.rb:52:in `require!'
from /home/armin/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/hanami-1.1.0/lib/hanami/components/components.rb:67:in `block (2 levels) in <module:Components>'
Here's one of my serializers: class SerializableFrFilter < JSONAPI::Serializable::Resource
extend JSONAPI::Serializable::Resource::KeyFormat
key_format ->(key) { key.to_s.dasherize }
type 'filters'
attribute :standard_company
attribute :standard_accounting_area
attribute :dynamic_period
has_many :accounting_areas do
linkage always: true
data do
@object.accounting_areas&.map do |id|
DwhProfitcenter.new(id: id)
end
end
end
end Serializing was working before I changed the Gemfile thx and best regards |
I just hit this same problem also. Is this fix going to be released? |
Any updates on this? Because I am stuck at the same issue. |
@beauby Do you need help with maintaining this? |
@Quintasan Yes, definitely. It wouldn't take much work, as @dawidof is already maintaining the base gems, so it would just be a matter of maintaining the Hanami integration. Please shoot me an email if you are still interested – I could provide general advice and explain various choices. |
Trying to use with Hanami (1.1.0) and encountered the following error:
NoMethodError: undefined method
render' for JSONAPI::Serializable::Renderer:Class /home/mihai/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/jsonapi-hanami-0.1.2/lib/jsonapi/hanami/rendering.rb:28:in
_jsonapi_render_success'/home/mihai/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/jsonapi-hanami-0.1.2/lib/jsonapi/hanami/rendering.rb:21:in
_jsonapi_render' /home/mihai/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/jsonapi-hanami-0.1.2/lib/jsonapi/hanami/rendering.rb:12:in
block (2 levels) in included'Problem seems to be that JSONAPI::Serializable::Renderer#render is an instance method not a class one in https://github.com/jsonapi-rb/jsonapi-serializable/blob/cabf10e319a3ce8e52412d6f435fdca458ac2b56/lib/jsonapi/serializable/renderer.rb#L38 (also in master) and is used as a class method in
jsonapi-hanami/lib/jsonapi/hanami/rendering.rb
Line 28 in 80c6d02
Maybe an oversight in Renderer class, missing something like this:
Gems versions:
jsonapi-hanami: 0.1.2
jsonapi-renderer: 0.2.0
jsonapi-serializable: 0.3.0
The text was updated successfully, but these errors were encountered: