1

I did a Rails extension as suggested by extending rails question using Harish Shetty answer.

I like it so much I decided to use it in my Rails Engine. Didn't quite work.

To make it work i place the file active_record_extensions in the Lib/[ENGINE] directory and added the Require active_record_extension to my engine.rb file.

This works, but I wonder if there's is a more proper way to do it.

Also. I ran into an Issue, (don't know if i'm allowed to piggyback a second question).

I have a Model called Translation. When i use the extended class method with that model i invoke an error 'Circular dependency detected' with raise "Circular dependency detected while autoloading constant #{qualified_name}"

I'm guessing that using the model extension exposed the name to something that doesn't like the fact that I used Translation. (doesn't happen with the other models I have). I get around it by not using the extend class method with that model.

Community
  • 1
  • 1
bobbdelsol
  • 996
  • 6
  • 21
  • Apparently i have a multithreading issue that showed up when i added the extension, probably unrelated. So ignore the piggyback question about the circular dependencies – bobbdelsol Jun 22 '14 at 16:37

0 Answers0