antonr/carrierwave-size-validator — pull request #1 by maxd (2013-04-30 18:45:35+00:00)
Title: Added ability to pass proc or lambda in options

Added ability to pass Proc or lambda in options. It is required to dynamically change validation options, for example in case when need to define different validation limits base on user service plan:

validates :file, presence: true, file_size: {
maximum: ->(pc) { Plan.service_plan(pc.current_user.service_plan.to_sym)[:max_product_content_size] }
}, if: ->(pc) { pc.content_type.to_sym == :file }