pdns 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ad237ab455c52946fc7c42f416b5a27009135a62
4
- data.tar.gz: 69de1a21d49f206c5192e50e9db23a0fb24fb46c
3
+ metadata.gz: 203a53d5363539e9fd4147cbbd88401c2f8e5683
4
+ data.tar.gz: 191ec0a2e5e9d2e64adefa5602276a710b0ada86
5
5
  SHA512:
6
- metadata.gz: 0a56837a72ddc2cc37016a191b0318190b5910c0e11a1088d52bd03ddceaf60446ef6e359de3bded8c01fa8c96a24625498c53e3ad0bc672bdb810a29bb86a9c
7
- data.tar.gz: 278e7fa5385302cf975adbb3503532f841583b1f9635b05f0cc468c607e8793ac2d7f37834d2a0104f40295757e74a7e3051e1a492852e10bc6ac575c0fac306
6
+ metadata.gz: df323e88b51de7f93df6eb5366fd8b93e7a41511b786b6c1b1e9baa077ea0638fdb27fbb97f9041f3074b840d7aa1336f64011df57e3ba6fe6295dbfa655a71b
7
+ data.tar.gz: c99b81265841b35bf879049cc7b9dce21a6338f0d5188bb426343317ec5d17f585362022d5fd3b22430fe6e1297ef12e7283453207e17c6ba97e4b8f211fc1f0
@@ -62,10 +62,8 @@ module PDNS
62
62
  end
63
63
 
64
64
  def set_record
65
- permitted = params.permit %i(id type content ttl prio auth)
66
- permitted[:name] = permitted.delete :id
65
+ record = @domain.records.where(record_params_with_id_to_name)
67
66
 
68
- record = @domain.records.where(permitted)
69
67
  raise ActiveRecord::RecordNotFound.new(
70
68
  "record not found"
71
69
  ) if record.empty?
@@ -73,6 +71,7 @@ module PDNS
73
71
  raise ActiveRecord::ActiveRecordError.new(
74
72
  "record not unique"
75
73
  ) unless record.one?
74
+
76
75
  @record = record.first
77
76
  end
78
77
 
@@ -80,6 +79,10 @@ module PDNS
80
79
  (params[:record] || params).permit %i(name type content ttl prio auth)
81
80
  end
82
81
 
82
+ def record_params_with_id_to_name
83
+ record_params.merge(name: params[:id])
84
+ end
85
+
83
86
  def delete_records
84
87
  params['before_delete_conditions'].each do |condition|
85
88
  condition.each { |k, v| @domain.records.where(k => v).destroy_all }
@@ -1,3 +1,3 @@
1
1
  module PDNS
2
- VERSION = '0.7.1'
2
+ VERSION = '0.7.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdns
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - linyows
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-12 00:00:00.000000000 Z
11
+ date: 2017-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails