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/compute_resource.rb
has_many :compute_profiles, :through => :compute_attributes
# The DB may contain compute resource from disabled plugins - filter them out here
scope :live_descendants, lambda { where(:type => self.descendants.map(&:to_s)) unless Rails.env.development? }
scope :live_descendants, -> { where(:type => self.descendants.map(&:to_s)) unless Rails.env.development? }
# with proc support, default_scope can no longer be chained
# include all default scoping here

Also available in: Unified diff