Skip to content

Pass controller reference to callable config value expressions.

Compare
Choose a tag to compare
@oreoshake oreoshake released this 18 Jun 22:01

#148

Facilitates better per-request config:

:enforce => lambda { |controller| controller.current_user.beta_testing? }

NOTE if you used lambda config values, this will raise an exception until you add the controller reference:

bad:

lambda { true }

good:

lambda { |controller| true }
proc { true }
proc { |controller| true }