Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Post < ActiveRecord::Base
- ...
- private
- ransacker :status, formatter: proc { |value|
- sym = Post.statuses_i18n.invert[value|]
- if sym.blank?
- raise "unexpected status accessed: #{value}"
- else
- sym
- end
- } do |parent|
- parent.table[:status]
- end
- ...
- end
Add Comment
Please, Sign In to add comment