Revision bb3572ff
Added by Daniel Lobato Garcia over 8 years ago
app/models/provisioning_template.rb | ||
---|---|---|
has_many :environments, :through => :template_combinations
|
||
has_many :template_combinations, :dependent => :destroy
|
||
belongs_to :template_kind
|
||
accepts_nested_attributes_for :template_combinations, :allow_destroy => true, :reject_if => lambda {|tc| tc[:environment_id].blank? and tc[:hostgroup_id].blank? }
|
||
accepts_nested_attributes_for :template_combinations, :allow_destroy => true,
|
||
:reject_if => ->(tc) { tc[:environment_id].blank? and tc[:hostgroup_id].blank? }
|
||
has_and_belongs_to_many :operatingsystems
|
||
has_many :os_default_templates
|
||
before_save :check_for_snippet_assoications
|
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.