简体   繁体   中英

Rails overload gem models

I'm loading models through a gem, and I want to overload those models. I'm in Rails 3.

What is the best way to do this?

-= More Info =-

Ultimately, I want to run thinking_sphinx against a model in the gem so:

class User < ActiveRecord::Base
 define_index do
  indexes some_index
 end
end

This takes over the gem's model. If I place it into the initializers, it works once then it won't continue to work on any rails server, WEbrick, unicorn, but it works fine in the console.

Thanks in advanced, Justin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM