foreman_host_extra_validator 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1eabba0847ad99f589822d9f0dac68320256de7e
4
- data.tar.gz: 97a3f9cf3dc3d2cf95a7e8f8a557f9b4f04778f7
3
+ metadata.gz: d026a0f8708c83656ab08dd2a9eb0b2ab473626c
4
+ data.tar.gz: 92edf688b7c110ce98bf20028080fc4ffdb33afc
5
5
  SHA512:
6
- metadata.gz: c688c43110a0f05f4eb6839608ef36472a28c3e93c5e0a5c45197593a097a43b3054517925fec00d4a3450cd1107e68e34f04540a0b6b89dce96ca8c130171c3
7
- data.tar.gz: b7ff2aff51281fb38b29d55540151637ffd8667a35af77ce12f0c4fd5572941a24f25a21ba68f4c943235f57581784da6f449d80d2801cbf34bff5126157d38b
6
+ metadata.gz: 76da39efa8f723812c3e25f999160c464fa4d401a6b833a97f9edf57e4866504ade2a63505c2d891c3f793c06d1bf23c51def50b267a67238b54ed1d331697ff
7
+ data.tar.gz: 23c49efc343e4f47f4686f8a5d5fdb49fef076e798af9e929c2445976315de0f0195b132d9736cff5e52911b6aefe7e7e2d2e482ac7175453e6cd830356d457e
@@ -1,14 +1,16 @@
1
1
  class Setting
2
- class HostValidation < ::Setting
2
+ class ForemanHostExtraValidator < ::Setting
3
3
  def self.load_defaults
4
- return unless ActiveRecord::Base.connection.table_exists?('settings')
4
+ # Check the table exists
5
5
  return unless super
6
6
 
7
- Setting.transaction do
7
+ self.transaction do
8
8
  [
9
- set('host_name_validation_regex', _('Default regex the name of a host is validated against'), '^[a-zA-Z0-9-_]+$')
10
- ].compact.each { |s| create s.update(:category => 'Setting::HostValidation') }
9
+ self.set('host_name_validation_regex', _('Default regex the name of a host is validated against'), '^[a-zA-Z0-9-_]+$')
10
+ ].compact.each { |s| self.create! s.update(:category => 'Setting::ForemanHostExtraValidator') }
11
11
  end
12
+
13
+ true
12
14
  end
13
15
  end
14
16
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanHostExtraValidator
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_host_extra_validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timo Goebel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-14 00:00:00.000000000 Z
11
+ date: 2015-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop