Support ActiveRecord 4

In ActiveRecord 3.2, `valid_options` is a class method.
But in ActiveRecord 4.0, it is an instance method.

So I use module method to support ActiveRecord 4.