nesquena / rabl

General ruby templating with json, bson, xml, plist and msgpack support
http://blog.codepath.com/2011/06/27/building-a-platform-api-on-rails/
MIT License
3.64k stars 334 forks source link

Rails 7 compatibility #749

Closed SeanLF closed 2 years ago

SeanLF commented 2 years ago

The following line needs to be changed to add support to Rails 7: https://github.com/nesquena/rabl/blob/855040f082920a85b6ced9388959043bcd46faa2/lib/rabl/template.rb#L65-L66

Seems to be resolved with:

# Rails 6.X Template 
 if defined?(ActionView) && defined?(Rails) && Rails::VERSION::MAJOR >= 6

(filing issue as rails 7 just reached rc1)

tagliala commented 2 years ago

Hi, there are also other points:

https://github.com/nesquena/rabl/blob/02b3464a6dfb27a4a34365303974604688d7eb2b/lib/rabl/railtie.rb#L25

https://github.com/nesquena/rabl/blob/04cb2961c46a922be266dcc9d9bbda7b13c778c1/lib/rabl/engine.rb#L396

https://github.com/nesquena/rabl/blob/02b3464a6dfb27a4a34365303974604688d7eb2b/lib/rabl.rb#L20-L22

We need to setup integration tests before doing this change. I can give a try during the weekend. PR are welcomed