views:

65

answers:

1

I have a model by the name Filter but due to the changes in reorganizing the filters from 2.0.3, it is conflicting with the

ActionController::Filters::Filter (class)

In my filters_controller.rb when I try to find the filter

Filter.find(:id)

as rails is infering the ActionController::Filters::Filter class rather than my model class Filter. Is there any work around other than renaming my model?

BTW: If I use ActiveRecord::Base::Filter.find(:id) to load my filter object, its working, but I am not quite sure if there are any unforseen implications by doing this, when rails try to unload/reload constants.

Thanks in advance.

+1  A: 

The safest way to deal with this is to rename your model. Otherwise you run the risk of being 'clever' and getting bitten by this later when it will be very difficult to debug.

_Kevin
Thanks for the response _Kevin. Actually I got the following feedback at ruby-forum.org. If I use ::Filter.find() that forces the ruby to look for my class rather than ActionController::Filters::Filter class. I think its safe.