Rails.application.routes.draw do
authorized = ->(request) { request.session[:user_id].present? }
constraints !authorized do
...
end
constraints authorized do
...
end
end
not_authorized = ->(request) { request.session[:user_id].blank? }
и "завязаться" на нее, то все работает.2.3.1 :001 > ->() { false }
=> #<Proc:0x00000001f744e0@(irb):1 (lambda)>
2.3.1 :002 > !(->() { false })
=> false