标签: ruby-on-rails ruby ruby-on-rails-4 lambda
我如何将以下代码转换为rubocop所描述的新lambda文字语法?
authenticate :user, lambda { |u| u.admin? } do mount Sidekiq::Web => '/sidekiq' end
我正在使用Rails 4.09和ruby 2.0.0
答案 0 :(得分:4)
authenticate :user, ->u{u.admin?} do mount Sidekiq::Web => '/sidekiq' end