Why does Jets define Rails module?


#1

I was trying to integrate my Jets app with Dynamoid (https://github.com/Dynamoid/dynamoid) instead of using Dynomite.

Since it’s possible to integrate Dynamoid with Rails app, Dynamoid checks if the Rails module is defined, and, because Jets defines the Rails module, Dynamoid believes that my app is a Rails app, and this is causing errors when Dynamoid tries to call Rails.application.

So, why do Jets define Rails module?


#2

@jalerson Thank for asking this as a question!

RE: So, why do Jets define Rails module?

Jets uses Rails to do a decent amount of work. One example is rendering. So that’s why Rails gets defined.

Opened up an issue for this: https://github.com/tongueroo/jets/issues/129 Definitely want to get this done. Will take some time to figure it out.


#3

Hi @tung,

thanks for your quick reply and for opening the issue on Github. Let’s keep our discussion there :+1:


#4

The Rails constant has been removed. Released in v1.5.0 CHANGELOG


#5

Hi @tung

I’m experiencing this exact issue running Jets 2.0.1 while trying to use dynamoid. I’m not entirely sure where it’s being loaded, but I’m having the same issue with Rails.application failing when trying to configure dynamoid.

Any suggestions on resolution?


#6

Interesting, was able to reproduce. So the spec is not properly guarding against this. Will have to dig into this.


#7

@scottwhudson Thanks for the report. Fixed in https://github.com/tongueroo/jets/pull/330 Released in v2.0.3

Note: Think have a better way to guard and regression test against this because the spec let it through.


#8

A+ on that response time, thanks for shipping a fix so quickly!