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/views/api/v1/hosts/show.json.rabl
:puppet_proxy_id, :certname, :image_id, :created_at, :updated_at,
:last_compile, :puppet_status, :root_pass
if SETTINGS[:organizations_enabled]
attribute :organization_id
end
if SETTINGS[:locations_enabled]
attribute :location_id
end
attribute :organization_id if SETTINGS[:organizations_enabled]
attribute :location_id if SETTINGS[:locations_enabled]
node :environment do |host|
{:environment => {:id => host.environment_id, :name => host.environment_name}}
......
end
node do |host|
{ :interfaces => partial("api/v1/interfaces/show", :object => host.interfaces) }
{ :interfaces => partial("api/v1/interfaces/show", :object => host.interfaces) }
end

Also available in: Unified diff