Code Monkey home page Code Monkey logo

Comments (6)

EmCousin avatar EmCousin commented on September 2, 2024 1

Hi @spijet, thanks for your issue. The formatter does use ActiveModel naming and serialization related methods, but only if the object to be serialized actually responds to these methods.

I'm working on a PR to actually remove Rails as a dependency : #12, feel free to check it out and confirm me if it works. Just as well, I am open to suggestions for improvement.

Thanks!

from grape-jsonapi.

spijet avatar spijet commented on September 2, 2024 1

Thanks a lot! I'll check this new branch locally in my app and will let you know if it works. I'll add comments (or even commits, maybe 😉) in the PR if anything comes up.

Can you hold this issue as open while I test the PR, please?

from grape-jsonapi.

EmCousin avatar EmCousin commented on September 2, 2024 1

@spijet PR merged and gem published to rubygems

from grape-jsonapi.

codingjerk avatar codingjerk commented on September 2, 2024

require 'rails' does not prevent library to be used with Sinatra-based apps tbc, but unnecessary dependency is unnecessary dependency.

from grape-jsonapi.

spijet avatar spijet commented on September 2, 2024

Actually, I just tried to comment out the require 'rails' line by hand and it seems to work fine. Haven't checked all the features yet, though. But still, this won't do in a production environment, where gems are pulled in on every deployment.

from grape-jsonapi.

spijet avatar spijet commented on September 2, 2024

It seems that I was (kinda) mistaken, and the Formatter module uses some ActiveRecord-specific stuff when working with collections, so it may be better to depend on ActiveRecord instead of Rails, unless I miss something else. :)

from grape-jsonapi.

Related Issues (11)

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.