url_attributes 1.2.0 → 1.3.0

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: f2b9ac4bb2330e36f9a6ce629b265c2926793569
4
- data.tar.gz: e78f758a61bc52cc6f65810e7a42e9e3e2efe0bf
3
+ metadata.gz: 46228fafa354d1bb8a052b28309de6845da16597
4
+ data.tar.gz: 534f5019b9493149941acd874a138536dfd10777
5
5
  SHA512:
6
- metadata.gz: cb761cd88a6478fa89114448792aa47c928eb61806d57965e75eb939070c85eaf65e2740e46efbc1d6690a670156c044dd60df0db9d66d640e445154b9577b7f
7
- data.tar.gz: b3ba4110e2e2a08f22d375c8e55895c2e09dfb6c4626c8f8ddaaaf0412bd2bcf4addeb82f91d1c9a51c413a88e6c2c15d03b6f079e32de68187b742915536fef
6
+ metadata.gz: 0872af40f92a9b85838587fc215e3cc1d58f6605fd0fc1bf127954246b4d37a7114e39788cd3e35a427143964eba4aaf4bca9e896a8d884c76704e1dae24c74d
7
+ data.tar.gz: 846b2809c85afc4f388b35071f66e81ce7180fb56d88e091b19fe4da40f3ed123a07f6f1f339db4e28c5df052ee7c99538534bec4d54f1b381db3566f46ebb51
@@ -9,7 +9,11 @@ if defined?(RSpec)
9
9
  model.valid?
10
10
  test_1 = !model.errors[attribute_name].include?("is not a valid URL")
11
11
  model.send :"#{attribute_name}=", "nohttp.com"
12
- model.run_callbacks :save
12
+ if @checked_before
13
+ model.run_callbacks @checked_before
14
+ else
15
+ model.run_callbacks :save
16
+ end
13
17
  test_2 = model.send(attribute_name) == "http://nohttp.com"
14
18
  test_0 && test_1 && test_2
15
19
  end
@@ -17,5 +21,7 @@ if defined?(RSpec)
17
21
  failure_message do |model|
18
22
  "expected that #{model} would have a URL attribute called #{attribute_name}, but it doesn't look like a URL"
19
23
  end
24
+
25
+ chain(:checked_before) { |callback| @checked_before = callback }
20
26
  end
21
27
  end
@@ -1,3 +1,3 @@
1
1
  module URLAttributes
2
- VERSION = "1.2.0"
2
+ VERSION = "1.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: url_attributes
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - George Millo
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  version: '0'
190
190
  requirements: []
191
191
  rubyforge_project:
192
- rubygems_version: 2.4.4
192
+ rubygems_version: 2.4.3
193
193
  signing_key:
194
194
  specification_version: 4
195
195
  summary: Simple URL attributes for ActiveRecord