serial_preference 1.2.0 → 1.2.1

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: db6bc7111161f864fadcbb7878a264501beb7514
4
- data.tar.gz: 7d47f5fc3201e10311f6696e794698fa14d35640
3
+ metadata.gz: 39563a5422c4baf2d2fc63bfe7c50308a41392cb
4
+ data.tar.gz: 1ee974a2f05b5e1d56830aa50605d6c71f61d9ab
5
5
  SHA512:
6
- metadata.gz: 20a7add6cc6780cfa01c4b30d948a4048c7e8870a1290720086c3defa51e7a9fb66cbf2a8e26076bd7397daf5d7c358953e19789df12b0f648e8aa1e5444541b
7
- data.tar.gz: e9396b647dcf00583ff800c50ab1a362f830dc98125fb83729c191f3570c79f84eb82f065ae345d8fffc9b5a3e73288f7c4faed98fae7691e83a3d46f7188132
6
+ metadata.gz: 47f556108dfffdc6e758388f154800ab769cb1bdc043979fc72be5f19066383690cfdb20b82abb3890c490055357a37a237297697c74ee151b712ce7e28eb637
7
+ data.tar.gz: d5efb7f465c92e223ab0de8c70261dc08adfb32e2570c697454aa96f568be9ff3af37bf5283ebe4bbea8db09b666f405eb664a8c09c74e0edb3e922a1f99d3a2
@@ -3,6 +3,17 @@ rvm:
3
3
  - 2.0.0
4
4
  - 2.1
5
5
  - 2.2
6
+ - 2.3
7
+ - 2.4
6
8
  - ruby-head
9
+ matrix:
10
+ allow_failures:
11
+ - rvm: 1.9.3
12
+ - rvm: 2.0.0
13
+ - rvm: 2.4
14
+ - rvm: ruby-head
15
+ gemfile:
16
+ - gemfiles/rails_4.gemfile
17
+ - gemfiles/rails_4.2.gemfile
7
18
 
8
19
  script: bundle exec rspec spec
@@ -0,0 +1,9 @@
1
+ appraise "rails-4" do
2
+ gem "activesupport", "4.0.0"
3
+ gem "activerecord", "4.0.0"
4
+ end
5
+
6
+ appraise "rails-4.2" do
7
+ gem "activesupport", "4.2.0"
8
+ gem "activerecord", "4.2.0"
9
+ end
data/Rakefile CHANGED
@@ -4,4 +4,8 @@ require 'rspec/core/rake_task'
4
4
 
5
5
  RSpec::Core::RakeTask.new(:spec)
6
6
 
7
- task :default => :spec
7
+ task default: :spec
8
+
9
+ if !ENV["APPRAISAL_INITIALIZED"] && !ENV["TRAVIS"]
10
+ task default: :appraisal
11
+ end
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activesupport", "4.2.0"
6
+ gem "activerecord", "4.2.0"
7
+
8
+ gemspec :path => "../"
@@ -0,0 +1,117 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ serial_preference (1.2.0)
5
+ activerecord (>= 3.0.0, < 5.0.0)
6
+ activesupport (>= 3.0.0, < 5.0.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (4.2.0)
12
+ actionview (= 4.2.0)
13
+ activesupport (= 4.2.0)
14
+ rack (~> 1.6.0)
15
+ rack-test (~> 0.6.2)
16
+ rails-dom-testing (~> 1.0, >= 1.0.5)
17
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
18
+ actionview (4.2.0)
19
+ activesupport (= 4.2.0)
20
+ builder (~> 3.1)
21
+ erubis (~> 2.7.0)
22
+ rails-dom-testing (~> 1.0, >= 1.0.5)
23
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
24
+ activemodel (4.2.0)
25
+ activesupport (= 4.2.0)
26
+ builder (~> 3.1)
27
+ activerecord (4.2.0)
28
+ activemodel (= 4.2.0)
29
+ activesupport (= 4.2.0)
30
+ arel (~> 6.0)
31
+ activesupport (4.2.0)
32
+ i18n (~> 0.7)
33
+ json (~> 1.7, >= 1.7.7)
34
+ minitest (~> 5.1)
35
+ thread_safe (~> 0.3, >= 0.3.4)
36
+ tzinfo (~> 1.1)
37
+ appraisal (2.1.0)
38
+ bundler
39
+ rake
40
+ thor (>= 0.14.0)
41
+ arel (6.0.4)
42
+ builder (3.2.3)
43
+ diff-lcs (1.3)
44
+ erubis (2.7.0)
45
+ i18n (0.8.1)
46
+ json (1.8.6)
47
+ loofah (2.0.3)
48
+ nokogiri (>= 1.5.9)
49
+ mini_portile2 (2.1.0)
50
+ minitest (5.10.1)
51
+ nokogiri (1.7.1)
52
+ mini_portile2 (~> 2.1.0)
53
+ rack (1.6.5)
54
+ rack-test (0.6.3)
55
+ rack (>= 1.0)
56
+ rails-deprecated_sanitizer (1.0.3)
57
+ activesupport (>= 4.2.0.alpha)
58
+ rails-dom-testing (1.0.8)
59
+ activesupport (>= 4.2.0.beta, < 5.0)
60
+ nokogiri (~> 1.6)
61
+ rails-deprecated_sanitizer (>= 1.0.1)
62
+ rails-html-sanitizer (1.0.3)
63
+ loofah (~> 2.0)
64
+ railties (4.2.0)
65
+ actionpack (= 4.2.0)
66
+ activesupport (= 4.2.0)
67
+ rake (>= 0.8.7)
68
+ thor (>= 0.18.1, < 2.0)
69
+ rake (12.0.0)
70
+ rspec (3.5.0)
71
+ rspec-core (~> 3.5.0)
72
+ rspec-expectations (~> 3.5.0)
73
+ rspec-mocks (~> 3.5.0)
74
+ rspec-core (3.5.4)
75
+ rspec-support (~> 3.5.0)
76
+ rspec-expectations (3.5.0)
77
+ diff-lcs (>= 1.2.0, < 2.0)
78
+ rspec-support (~> 3.5.0)
79
+ rspec-mocks (3.5.0)
80
+ diff-lcs (>= 1.2.0, < 2.0)
81
+ rspec-support (~> 3.5.0)
82
+ rspec-rails (3.5.2)
83
+ actionpack (>= 3.0)
84
+ activesupport (>= 3.0)
85
+ railties (>= 3.0)
86
+ rspec-core (~> 3.5.0)
87
+ rspec-expectations (~> 3.5.0)
88
+ rspec-mocks (~> 3.5.0)
89
+ rspec-support (~> 3.5.0)
90
+ rspec-support (3.5.0)
91
+ shoulda (3.5.0)
92
+ shoulda-context (~> 1.0, >= 1.0.1)
93
+ shoulda-matchers (>= 1.4.1, < 3.0)
94
+ shoulda-context (1.2.2)
95
+ shoulda-matchers (2.8.0)
96
+ activesupport (>= 3.0.0)
97
+ sqlite3 (1.3.13)
98
+ thor (0.19.4)
99
+ thread_safe (0.3.6)
100
+ tzinfo (1.2.3)
101
+ thread_safe (~> 0.1)
102
+
103
+ PLATFORMS
104
+ ruby
105
+
106
+ DEPENDENCIES
107
+ activerecord (= 4.2.0)
108
+ activesupport (= 4.2.0)
109
+ appraisal
110
+ rspec (>= 3.0.0)
111
+ rspec-rails
112
+ serial_preference!
113
+ shoulda
114
+ sqlite3
115
+
116
+ BUNDLED WITH
117
+ 1.13.2
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activesupport", "4.0.0"
6
+ gem "activerecord", "4.0.0"
7
+
8
+ gemspec :path => "../"
@@ -0,0 +1,98 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ serial_preference (1.2.0)
5
+ activerecord (>= 3.0.0, < 5.0.0)
6
+ activesupport (>= 3.0.0, < 5.0.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionpack (4.0.0)
12
+ activesupport (= 4.0.0)
13
+ builder (~> 3.1.0)
14
+ erubis (~> 2.7.0)
15
+ rack (~> 1.5.2)
16
+ rack-test (~> 0.6.2)
17
+ activemodel (4.0.0)
18
+ activesupport (= 4.0.0)
19
+ builder (~> 3.1.0)
20
+ activerecord (4.0.0)
21
+ activemodel (= 4.0.0)
22
+ activerecord-deprecated_finders (~> 1.0.2)
23
+ activesupport (= 4.0.0)
24
+ arel (~> 4.0.0)
25
+ activerecord-deprecated_finders (1.0.4)
26
+ activesupport (4.0.0)
27
+ i18n (~> 0.6, >= 0.6.4)
28
+ minitest (~> 4.2)
29
+ multi_json (~> 1.3)
30
+ thread_safe (~> 0.1)
31
+ tzinfo (~> 0.3.37)
32
+ appraisal (2.1.0)
33
+ bundler
34
+ rake
35
+ thor (>= 0.14.0)
36
+ arel (4.0.2)
37
+ builder (3.1.4)
38
+ diff-lcs (1.3)
39
+ erubis (2.7.0)
40
+ i18n (0.8.1)
41
+ minitest (4.7.5)
42
+ multi_json (1.12.1)
43
+ rack (1.5.5)
44
+ rack-test (0.6.3)
45
+ rack (>= 1.0)
46
+ railties (4.0.0)
47
+ actionpack (= 4.0.0)
48
+ activesupport (= 4.0.0)
49
+ rake (>= 0.8.7)
50
+ thor (>= 0.18.1, < 2.0)
51
+ rake (12.0.0)
52
+ rspec (3.5.0)
53
+ rspec-core (~> 3.5.0)
54
+ rspec-expectations (~> 3.5.0)
55
+ rspec-mocks (~> 3.5.0)
56
+ rspec-core (3.5.4)
57
+ rspec-support (~> 3.5.0)
58
+ rspec-expectations (3.5.0)
59
+ diff-lcs (>= 1.2.0, < 2.0)
60
+ rspec-support (~> 3.5.0)
61
+ rspec-mocks (3.5.0)
62
+ diff-lcs (>= 1.2.0, < 2.0)
63
+ rspec-support (~> 3.5.0)
64
+ rspec-rails (3.5.2)
65
+ actionpack (>= 3.0)
66
+ activesupport (>= 3.0)
67
+ railties (>= 3.0)
68
+ rspec-core (~> 3.5.0)
69
+ rspec-expectations (~> 3.5.0)
70
+ rspec-mocks (~> 3.5.0)
71
+ rspec-support (~> 3.5.0)
72
+ rspec-support (3.5.0)
73
+ shoulda (3.5.0)
74
+ shoulda-context (~> 1.0, >= 1.0.1)
75
+ shoulda-matchers (>= 1.4.1, < 3.0)
76
+ shoulda-context (1.2.2)
77
+ shoulda-matchers (2.8.0)
78
+ activesupport (>= 3.0.0)
79
+ sqlite3 (1.3.13)
80
+ thor (0.19.4)
81
+ thread_safe (0.3.6)
82
+ tzinfo (0.3.53)
83
+
84
+ PLATFORMS
85
+ ruby
86
+
87
+ DEPENDENCIES
88
+ activerecord (= 4.0.0)
89
+ activesupport (= 4.0.0)
90
+ appraisal
91
+ rspec (>= 3.0.0)
92
+ rspec-rails
93
+ serial_preference!
94
+ shoulda
95
+ sqlite3
96
+
97
+ BUNDLED WITH
98
+ 1.13.2
@@ -66,7 +66,7 @@ module SerialPreference
66
66
 
67
67
  def write_preference_attribute(store_attribute, key, value)
68
68
  attribute = send(store_attribute)
69
- if value != attribute[key]
69
+ if value != attribute[key.to_sym]
70
70
  send :"#{store_attribute}_will_change!"
71
71
  attribute[key.to_sym] = value
72
72
  end
@@ -1,3 +1,3 @@
1
1
  module SerialPreference
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
@@ -17,12 +17,12 @@ Gem::Specification.new do |gem|
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
19
 
20
- gem.add_runtime_dependency "activesupport", ">= 3.0.0"
21
- gem.add_runtime_dependency "activerecord", ">= 3.0.0"
20
+ gem.add_runtime_dependency "activesupport", ">= 3.0.0", "< 5.0.0"
21
+ gem.add_runtime_dependency "activerecord", ">= 3.0.0", "< 5.0.0"
22
22
 
23
23
  gem.add_development_dependency 'sqlite3'
24
24
  gem.add_development_dependency 'rspec', ">= 3.0.0"
25
25
  gem.add_development_dependency 'rspec-rails'
26
26
  gem.add_development_dependency "shoulda"
27
-
27
+ gem.add_development_dependency "appraisal"
28
28
  end
@@ -87,6 +87,13 @@ describe SerialPreference::HasSerialPreferences do
87
87
  expect(DummyClass.new.creditable?).to eq(false)
88
88
  end
89
89
 
90
+ it "should clear existing preference value" do
91
+ d = DummyClass.new
92
+ d.vat_no = "abc"
93
+ expect(d.vat_no).to eq("abc")
94
+ d.vat_no = nil
95
+ expect(d.vat_no).to eq(nil)
96
+ end
90
97
  end
91
98
 
92
99
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serial_preference
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aditya Sanghi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-02 00:00:00.000000000 Z
11
+ date: 2017-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -17,6 +17,9 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 3.0.0
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: 5.0.0
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -24,6 +27,9 @@ dependencies:
24
27
  - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: 3.0.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: 5.0.0
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: activerecord
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -31,6 +37,9 @@ dependencies:
31
37
  - - ">="
32
38
  - !ruby/object:Gem::Version
33
39
  version: 3.0.0
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: 5.0.0
34
43
  type: :runtime
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -38,6 +47,9 @@ dependencies:
38
47
  - - ">="
39
48
  - !ruby/object:Gem::Version
40
49
  version: 3.0.0
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: 5.0.0
41
53
  - !ruby/object:Gem::Dependency
42
54
  name: sqlite3
43
55
  requirement: !ruby/object:Gem::Requirement
@@ -94,6 +106,20 @@ dependencies:
94
106
  - - ">="
95
107
  - !ruby/object:Gem::Version
96
108
  version: '0'
109
+ - !ruby/object:Gem::Dependency
110
+ name: appraisal
111
+ requirement: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ version: '0'
116
+ type: :development
117
+ prerelease: false
118
+ version_requirements: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
97
123
  description: Serialized Preferences for your models
98
124
  email:
99
125
  - aditya.sanghi@risingsuntech.net
@@ -104,10 +130,15 @@ files:
104
130
  - ".gitignore"
105
131
  - ".rspec"
106
132
  - ".travis.yml"
133
+ - Appraisals
107
134
  - Gemfile
108
135
  - LICENSE.txt
109
136
  - README.md
110
137
  - Rakefile
138
+ - gemfiles/rails_4.2.gemfile
139
+ - gemfiles/rails_4.2.gemfile.lock
140
+ - gemfiles/rails_4.gemfile
141
+ - gemfiles/rails_4.gemfile.lock
111
142
  - lib/serial_preference.rb
112
143
  - lib/serial_preference/has_preference_map.rb
113
144
  - lib/serial_preference/preference_definition.rb
@@ -139,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
170
  version: '0'
140
171
  requirements: []
141
172
  rubyforge_project:
142
- rubygems_version: 2.4.5.1
173
+ rubygems_version: 2.4.8
143
174
  signing_key:
144
175
  specification_version: 4
145
176
  summary: Serialized Preferences for your models
@@ -150,3 +181,4 @@ test_files:
150
181
  - spec/preference_definition_spec.rb
151
182
  - spec/preferenzer_spec.rb
152
183
  - spec/spec_helper.rb
184
+ has_rdoc: