Class: ForemanPuppet::PuppetclassLookupKey
- Inherits:
-
LookupKey
- Object
- LookupKey
- ForemanPuppet::PuppetclassLookupKey
- Defined in:
- app/models/foreman_puppet/puppetclass_lookup_key.rb
Class Method Summary collapse
Instance Method Summary collapse
- #audit_class ⇒ Object
- #cast_default_value ⇒ Object
- #check_override_selected ⇒ Object
- #editable_by_user? ⇒ Boolean
- #param_class ⇒ Object
- #puppet? ⇒ Boolean
- #validate_default_value ⇒ Object
Class Method Details
.humanize_class_name ⇒ Object
54 55 56 |
# File 'app/models/foreman_puppet/puppetclass_lookup_key.rb', line 54 def self.humanize_class_name 'Smart class parameter' end |
Instance Method Details
#audit_class ⇒ Object
30 31 32 |
# File 'app/models/foreman_puppet/puppetclass_lookup_key.rb', line 30 def audit_class param_class end |
#cast_default_value ⇒ Object
34 35 36 37 |
# File 'app/models/foreman_puppet/puppetclass_lookup_key.rb', line 34 def cast_default_value super unless omit true end |
#check_override_selected ⇒ Object
48 49 50 51 52 |
# File 'app/models/foreman_puppet/puppetclass_lookup_key.rb', line 48 def check_override_selected return if (changed - %w[description override]).empty? return if override? errors.add(:override, _('must be true to edit the parameter')) end |
#editable_by_user? ⇒ Boolean
22 23 24 |
# File 'app/models/foreman_puppet/puppetclass_lookup_key.rb', line 22 def editable_by_user? PuppetclassLookupKey.(:edit_external_parameters).exists?(id: id) end |
#param_class ⇒ Object
26 27 28 |
# File 'app/models/foreman_puppet/puppetclass_lookup_key.rb', line 26 def param_class param_classes.first end |
#puppet? ⇒ Boolean
44 45 46 |
# File 'app/models/foreman_puppet/puppetclass_lookup_key.rb', line 44 def puppet? true end |
#validate_default_value ⇒ Object
39 40 41 42 |
# File 'app/models/foreman_puppet/puppetclass_lookup_key.rb', line 39 def validate_default_value super unless omit true end |