Class: Parameter

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Authorization
Defined in:
app/models/parameter.rb

Constant Summary collapse

PRIORITY =
{:common_parameter => 0, :domain_parameter => 1, :os_parameter => 2, :group_parameter => 3 , :host_parameter => 4}

Instance Attribute Summary collapse

Class Method Summary collapse

Methods included from Authorization

#enforce_create_permissions, #enforce_destroy_permissions, #enforce_edit_permissions, #enforce_permissions, included, #permission_failed?

Instance Attribute Details

#nestedObject

Returns the value of attribute nested


10
11
12
# File 'app/models/parameter.rb', line 10

def nested
  @nested
end

Class Method Details

.reassign_prioritiesObject


16
17
18
19
20
21
# File 'app/models/parameter.rb', line 16

def self.reassign_priorities
  # priorities will be reassigned because of after_initialize
  find_in_batches do |params|
    params.each { |param| param.update_attribute(:priority, param.priority) }
  end
end