Why does Jets define Rails module?

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?

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

Hi @tung,

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

1 Like

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

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?

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

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

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