graphiti-api / graphiti

Stylish Graph APIs
https://www.graphiti.dev/
MIT License
960 stars 138 forks source link

Fix standalone requiring #474

Closed factyy closed 3 weeks ago

factyy commented 3 weeks ago

It seems that right now you cannot simply require 'graphiti' without requiring active_support prior to it.

You get the following output:

...gems/activesupport-7.1.3.4/lib/active_support/core_ext/array/conversions.rb:108:in `<class:Array>': undefined method `deprecator' for module ActiveSupport (NoMethodError)

  deprecate to_default_s: :to_s, deprecator: ActiveSupport.deprecator
                                                          ^^^^^^^^^^^
Did you mean?  deprecate_constant

It looks like the problem is caused by the following code: https://github.com/graphiti-api/graphiti/blob/1479411646a841be56f8dda613b4e9f63ba2b576/lib/graphiti.rb#L4

This PR just places require "active_support/deprecation" on top of the list and adds require "active_support/deprecator" on the next line to satisfy dependencies which seems to solve the issue

Edit: this issue is probably Rails 7 and newer only due to internal changes in ActiveSupport

factyy commented 3 weeks ago

Looks like there are backward compatibility issues. Will fix them and patch this PR

factyy commented 3 weeks ago

@jkeen , this PR is ok to review now. Please take a look :)

jkeen commented 3 weeks ago

@factyy Thanks!

github-actions[bot] commented 3 weeks ago

:tada: This PR is included in version 1.7.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: