y9v/carrierwave-base64

"mount_base_64_uploader" method not recognized from rails console

JackCurrie opened this issue · 3 comments

Hello!

I'm running into a strange thing currently, which I believe is in someway inherent to this gem, though it it possible that something is afoot in my rails environment...

The gem works flawlessly in tests, and I am able to access models with the mount_base_64_uploader on it when program execution is paused in debug statements.

However, when enter the rails console and I try to access an activerecord model which contains that uploader, it throws the following error. (the model in my case is ClientPhoto).

captura de pantalla 2018-04-16 a la s 12 54 38 p m

Any insights as to why this may be happening?

y9v commented

Hello!

Could you try to load ActiveRecord first? (just call ActiveRecord) in the console before calling ClientPhoto.

I suppose it has something to do with the Railtie - https://github.com/lebedev-yury/carrierwave-base64/blob/master/lib/carrierwave/base64/railtie.rb#L4

Just tried it out, got the same error message : /

Looks like a good guess as to where it might be occurring, possibly I will snoop around this a bit if I get some free time.
Thanks

y9v commented

@JackCurrie any updates on the issue? I will close it, if you still have the problem, feel free to reopen it