Revision bb3572ff
Added by Daniel Lobato Garcia over 8 years ago
app/views/api/v1/images/show.json.rabl | ||
---|---|---|
object @image
|
||
|
||
attributes :id, :operatingsystem_id, :compute_resource_id, :architecture_id, :uuid, :username, :name, :created_at, :updated_at
|
||
attribute :iam_role, :if => lambda { |img| img.compute_resource.kind_of? Foreman::Model::EC2 }
|
||
attribute :iam_role, :if => ->(img) { img.compute_resource.is_a? Foreman::Model::EC2 }
|
Also available in: Unified diff
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.