Named_scope重构为rails 4

时间:2015-03-05 17:47:04

标签: ruby-on-rails ruby-on-rails-3 refactoring

我有named_scope :business, :conditions => "processing_time_15_minutes is null"

如何重构rails4风格

THX

2 个答案:

答案 0 :(得分:1)

你走了:

scope :business, -> { where(processing_time_15_minutes: nil) }

答案 1 :(得分:1)

scope :business, -> { where(processing_time_15_minutes: nil) }