Giter Club home page Giter Club logo

Comments (7)

beauby avatar beauby commented on June 19, 2024 3

@mihaimuntenas Thanks for reporting this – it should be fixed by using master (gem 'jsonapi-hanami', github: 'jsonapi-rb/jsonapi-hanami'). I'll try to publish the new version soon.

from jsonapi-hanami.

HarryBar avatar HarryBar commented on June 19, 2024

Hi, i have still the same issue. Could you fix that please so i can remove my monkey patch. Thanks

from jsonapi-hanami.

wuarmin avatar wuarmin commented on June 19, 2024

@beauby
If have the same problems. After changing Gemfile as you mentioned, I get following error

/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

from jsonapi-hanami.

bradrobertson avatar bradrobertson commented on June 19, 2024

I just hit this same problem also. Is this fix going to be released?

from jsonapi-hanami.

nomanurrehman avatar nomanurrehman commented on June 19, 2024

Any updates on this? Because I am stuck at the same issue.

from jsonapi-hanami.

Quintasan avatar Quintasan commented on June 19, 2024

@beauby Do you need help with maintaining this?

from jsonapi-hanami.

beauby avatar beauby commented on June 19, 2024

@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.

from jsonapi-hanami.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.