sferik/rails_admin — pull request #1053 by adrianmacneil (2012-03-28 00:36:50+00:00)
Title: Support enumeration class methods

Thanks for rails admin, it's amazing.

The only small issue I have is that for the automatic enum methods (object#name_enum) it seems much cleaner to use class methods rather than instance methods.

The reason for this is when creating e.g. search forms, I want access to the enum without having to create an instance of an object. It's a pain having to create both class and instance methods for this, or creating a new object just to access the enum values.

I've attached a failing test case to describe the expected behavior, basically RA should check for `Foo.color_enum` as well as `Foo.new.color_enum`.

I'm not really sure how to go about implementing this, but happy to give it a try if you like the feature.

Please let me know if there's a better way of doing this that I'm missing.

Thanks again!