enum_help
enum_help copied to clipboard
Add define_collection_i18n_method_before_type_cast
Add define_collection_i18n_method_before_type_cast method.
Since the ransack gem does not support enum string search, I added a method that returns a before type cast value.
[1] pry(main)> Advertiser.statuses_i18n
=> {"default"=>"未承認", "approved"=>"承認", "rejected"=>"否認"}
[2] pry(main)> Advertiser.statuses_i18n_before_type_cast
=> {10=>"未承認", 20=>"承認", 30=>"否認"}