Project

General

Profile

« Previous | Next » 

Revision bb3572ff

Added by Daniel Lobato Garcia over 8 years ago

Refs #3809 - Stabby lambda syntax for oneliners

I started by spotting log.rb which didn't have a lambda wrapping its
default scope, as needed by Rails 4. Since the style guide and most
Rails 4 documents used the stabby lambda, I turned on the cop so that we
use it everywhere there's a oneliner lambda.

View differences:

app/models/user_mail_notification.rb
validates :user_id, :presence => true
validates :mail_notification, :presence => true
scope :daily, lambda { where(:interval => 'Daily') }
scope :weekly, lambda { where(:interval => 'Weekly') }
scope :monthly, lambda { where(:interval => 'Monthly') }
scope :daily, -> { where(:interval => 'Daily') }
scope :weekly, -> { where(:interval => 'Weekly') }
scope :monthly, -> { where(:interval => 'Monthly') }
def deliver(options = {})
return unless user.mail_enabled?

Also available in: Unified diff