How rails can use other orm's generator

I’m just suddenly curious about this, so I looked up a little about Rails source code.

I found this code is how it get the other ORM class.

"#{options[:orm].to_s.camelize}::Generators::ActiveModel".constantize

Then I checked mongoid, found it has the class: Mongoid::Generators::ActiveModel in lib/rails/mongoid_generator.rb.

blog comments powered by Disqus