random_unique_id 1.0.0 → 1.0.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: 7483d54993b6187363e8a30e6bdfeaa203e82aae
4
- data.tar.gz: 620a1b73ab14efcd5ad0203c9730f29e0710de40
3
+ metadata.gz: 9f9b42d211563950847cf37b80f8c9acc1158463
4
+ data.tar.gz: 71c15c22daa64608a593e4b3437d4c417101ad5c
5
5
  SHA512:
6
- metadata.gz: 434ad3202151c28c8ae1233aa679baa46b1fa15212b1bc6f36b95522f489a8c58c23a28a269bc3485f90ad5b78acbc36a0e62b8e00c3a452d74d0af090eaca04
7
- data.tar.gz: 4abf60bc4843a771d17f4082ec280ba1681d7f2efa0b0ab66418bc50f6e855ece38ae0676e34bf6d58b58417e4534f8c910f22fe535a0c6cd6549544a7d02c4a
6
+ metadata.gz: 0c7d1c34b1b6f78412834f3fdcb9415f8b15c3eb8e79d4bd9a5884d6ba06045a4b184eb5bd7837892e96b8d5ed9552c0060726b187202100ee2a277e2e95ab8e
7
+ data.tar.gz: 8b52abe0ce84b10d11b9e082e31371b5715140006e5e47dba2861b47a8c92b3c0a8275e9e1160cc6ae620ed0ffd9d300e863a970a849098356b73bdddfbaba5c
data/.travis.yml CHANGED
@@ -9,3 +9,7 @@ gemfile:
9
9
  - gemfiles/rails_3_2.gemfile
10
10
  - gemfiles/rails_4_0.gemfile
11
11
  - gemfiles/rails_4_1.gemfile
12
+ addons:
13
+ code_climate:
14
+ repo_token:
15
+ secure: "ZRzKaV0l9b+TvfDzDw9Vw8KgCWUYyPhfP8ipsYehdwu4VbeQ+3hefQWN5zF3VMtO9tywBthi0fIxwmxbZGqcd0B3iYQ31yODQJOWIo9bUowYDnOzxQbRHjaALuNvE85+u7+RnXkgmMlEEgzoyVbROgP19QeHfk37K672vsg1POo="
data/Appraisals CHANGED
@@ -10,4 +10,8 @@ end
10
10
 
11
11
  appraise "rails-4_1" do
12
12
  gem "actionmailer", "~> 4.1.0"
13
- end
13
+ end
14
+
15
+ appraise "rails-4_2" do
16
+ gem "actionmailer", "~> 4.2.0"
17
+ end
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  Authoritative changelog in README.md.
2
2
 
3
+ ## Version 1.0.1 (Dec 22, 2014)
4
+ - Added support for Rails 4.2.
5
+
3
6
  ## Version 1.0.0 (Oct 28, 2014)
4
7
  - Added RandomUniqueId::Util.set_initial_ids.
5
8
  - Started testing Ruby 2.1.2 and 2.1.3.
@@ -15,4 +18,4 @@ Authoritative changelog in README.md.
15
18
  - Started testing with Ruby 2.1.
16
19
 
17
20
  ## Version 0.1.0 (Jan 6, 2014)
18
- - Initial release of the code extracted from [Watu](http://github.com/watu).
21
+ - Initial release of the code extracted from [Watu](http://github.com/watu).
data/README.md CHANGED
@@ -11,7 +11,7 @@ This gem will generate a random unique id for your active record records that yo
11
11
  all external interactions with users. The goal is for you to be able to hide how many records you have, for business
12
12
  purposes, but also to make IDs non-predictable.
13
13
 
14
- This gem is built to work with Ruby 1.9, 2.0, 2.1 as well as with Rails 3.2, 4.0 and 4.1. All of these cases are
14
+ This gem is built to work with Ruby 1.9, 2.0, 2.1 as well as with Rails 3.2, 4.0, 4.1 and 4.2. All of these cases are
15
15
  [continuously tested for](https://travis-ci.org/watu/random_unique_id).
16
16
 
17
17
  ## Installation
@@ -69,8 +69,18 @@ records. For example:
69
69
  end
70
70
  end
71
71
 
72
+ ## Users
73
+
74
+ This gem is being used by:
75
+
76
+ - [Watu](https://watuapp.com)
77
+ - You? please, let us know if you are using this gem.
78
+
72
79
  ## Changelog
73
80
 
81
+ ### Version 1.0.1 (Dec 22, 2014)
82
+ - Added support for Rails 4.2.
83
+
74
84
  ### Version 1.0.0 (Oct 28, 2014)
75
85
  - Added RandomUniqueId::Util.set_initial_ids.
76
86
  - Started testing Ruby 2.1.2 and 2.1.3.
@@ -91,7 +101,13 @@ records. For example:
91
101
  ## Contributing
92
102
 
93
103
  1. Fork it
94
- 2. Create your feature branch (`git checkout -b my-new-feature`)
95
- 3. Commit your changes (`git commit -am "Add some feature"`)
96
- 4. Push to the branch (`git push origin my-new-feature`)
97
- 5. Create new Pull Request
104
+ 1. Create your feature branch (`git checkout -b my-new-feature`)
105
+ 1. Code your thing, write tests
106
+ 1. Run tests:
107
+
108
+ bundle install
109
+ appraisal
110
+ appraisal rake test
111
+ 1. Commit your changes (`git commit -am "Add some feature"`)
112
+ 1. Push to the branch (`git push origin my-new-feature`)
113
+ 1. Create new Pull Request
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- random_unique_id (0.2.1)
4
+ random_unique_id (1.0.1)
5
5
  activerecord (>= 3.2.0)
6
6
  activesupport (>= 3.2.0)
7
7
 
@@ -39,6 +39,8 @@ GEM
39
39
  thor (>= 0.14.0)
40
40
  arel (3.0.3)
41
41
  builder (3.0.4)
42
+ codeclimate-test-reporter (0.4.1)
43
+ simplecov (>= 0.7.1, < 1.0.0)
42
44
  coveralls (0.7.1)
43
45
  multi_json (~> 1.3)
44
46
  rest-client
@@ -131,6 +133,7 @@ DEPENDENCIES
131
133
  actionmailer (~> 3.2.0)
132
134
  appraisal
133
135
  bundler
136
+ codeclimate-test-reporter
134
137
  coveralls
135
138
  minitest
136
139
  minitest-rails
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- random_unique_id (0.2.1)
4
+ random_unique_id (1.0.1)
5
5
  activerecord (>= 3.2.0)
6
6
  activesupport (>= 3.2.0)
7
7
 
@@ -39,6 +39,8 @@ GEM
39
39
  thor (>= 0.14.0)
40
40
  arel (4.0.2)
41
41
  builder (3.1.4)
42
+ codeclimate-test-reporter (0.4.1)
43
+ simplecov (>= 0.7.1, < 1.0.0)
42
44
  coveralls (0.7.1)
43
45
  multi_json (~> 1.3)
44
46
  rest-client
@@ -115,6 +117,7 @@ DEPENDENCIES
115
117
  actionmailer (~> 4.0.0)
116
118
  appraisal
117
119
  bundler
120
+ codeclimate-test-reporter
118
121
  coveralls
119
122
  minitest
120
123
  minitest-rails
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- random_unique_id (0.2.1)
4
+ random_unique_id (1.0.1)
5
5
  activerecord (>= 3.2.0)
6
6
  activesupport (>= 3.2.0)
7
7
 
@@ -41,6 +41,8 @@ GEM
41
41
  thor (>= 0.14.0)
42
42
  arel (5.0.1.20140414130214)
43
43
  builder (3.2.2)
44
+ codeclimate-test-reporter (0.4.1)
45
+ simplecov (>= 0.7.1, < 1.0.0)
44
46
  coveralls (0.7.1)
45
47
  multi_json (~> 1.3)
46
48
  rest-client
@@ -113,6 +115,7 @@ DEPENDENCIES
113
115
  actionmailer (~> 4.1.0)
114
116
  appraisal
115
117
  bundler
118
+ codeclimate-test-reporter
116
119
  coveralls
117
120
  minitest
118
121
  minitest-rails
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "actionmailer", "~> 4.2.0"
6
+
7
+ gemspec :path => "../"
@@ -0,0 +1,147 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ random_unique_id (1.0.1)
5
+ activerecord (>= 3.2.0)
6
+ activesupport (>= 3.2.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ actionmailer (4.2.0)
12
+ actionpack (= 4.2.0)
13
+ actionview (= 4.2.0)
14
+ activejob (= 4.2.0)
15
+ mail (~> 2.5, >= 2.5.4)
16
+ rails-dom-testing (~> 1.0, >= 1.0.5)
17
+ actionpack (4.2.0)
18
+ actionview (= 4.2.0)
19
+ activesupport (= 4.2.0)
20
+ rack (~> 1.6.0)
21
+ rack-test (~> 0.6.2)
22
+ rails-dom-testing (~> 1.0, >= 1.0.5)
23
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
24
+ actionview (4.2.0)
25
+ activesupport (= 4.2.0)
26
+ builder (~> 3.1)
27
+ erubis (~> 2.7.0)
28
+ rails-dom-testing (~> 1.0, >= 1.0.5)
29
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
30
+ activejob (4.2.0)
31
+ activesupport (= 4.2.0)
32
+ globalid (>= 0.3.0)
33
+ activemodel (4.2.0)
34
+ activesupport (= 4.2.0)
35
+ builder (~> 3.1)
36
+ activerecord (4.2.0)
37
+ activemodel (= 4.2.0)
38
+ activesupport (= 4.2.0)
39
+ arel (~> 6.0)
40
+ activesupport (4.2.0)
41
+ i18n (~> 0.7)
42
+ json (~> 1.7, >= 1.7.7)
43
+ minitest (~> 5.1)
44
+ thread_safe (~> 0.3, >= 0.3.4)
45
+ tzinfo (~> 1.1)
46
+ ansi (1.4.3)
47
+ appraisal (1.0.2)
48
+ bundler
49
+ rake
50
+ thor (>= 0.14.0)
51
+ arel (6.0.0)
52
+ builder (3.2.2)
53
+ codeclimate-test-reporter (0.4.3)
54
+ simplecov (>= 0.7.1, < 1.0.0)
55
+ coveralls (0.7.1)
56
+ multi_json (~> 1.3)
57
+ rest-client
58
+ simplecov (>= 0.7)
59
+ term-ansicolor
60
+ thor
61
+ docile (1.1.5)
62
+ erubis (2.7.0)
63
+ globalid (0.3.0)
64
+ activesupport (>= 4.1.0)
65
+ i18n (0.7.0)
66
+ json (1.8.1)
67
+ loofah (2.0.1)
68
+ nokogiri (>= 1.5.9)
69
+ mail (2.6.3)
70
+ mime-types (>= 1.16, < 3)
71
+ metaclass (0.0.4)
72
+ mime-types (2.4.3)
73
+ mini_portile (0.6.1)
74
+ minitest (5.5.0)
75
+ minitest-rails (2.1.1)
76
+ minitest (~> 5.4)
77
+ railties (~> 4.1)
78
+ minitest-reporters (1.0.8)
79
+ ansi
80
+ builder
81
+ minitest (>= 5.0)
82
+ ruby-progressbar
83
+ mocha (1.1.0)
84
+ metaclass (~> 0.0.1)
85
+ multi_json (1.10.1)
86
+ netrc (0.10.2)
87
+ nokogiri (1.6.5)
88
+ mini_portile (~> 0.6.0)
89
+ rack (1.6.0)
90
+ rack-test (0.6.2)
91
+ rack (>= 1.0)
92
+ rails-deprecated_sanitizer (1.0.3)
93
+ activesupport (>= 4.2.0.alpha)
94
+ rails-dom-testing (1.0.5)
95
+ activesupport (>= 4.2.0.beta, < 5.0)
96
+ nokogiri (~> 1.6.0)
97
+ rails-deprecated_sanitizer (>= 1.0.1)
98
+ rails-html-sanitizer (1.0.1)
99
+ loofah (~> 2.0)
100
+ railties (4.2.0)
101
+ actionpack (= 4.2.0)
102
+ activesupport (= 4.2.0)
103
+ rake (>= 0.8.7)
104
+ thor (>= 0.18.1, < 2.0)
105
+ rake (10.4.2)
106
+ rest-client (1.7.2)
107
+ mime-types (>= 1.16, < 3.0)
108
+ netrc (~> 0.7)
109
+ ruby-progressbar (1.7.1)
110
+ shoulda (3.5.0)
111
+ shoulda-context (~> 1.0, >= 1.0.1)
112
+ shoulda-matchers (>= 1.4.1, < 3.0)
113
+ shoulda-context (1.2.1)
114
+ shoulda-matchers (2.7.0)
115
+ activesupport (>= 3.0.0)
116
+ simplecov (0.9.1)
117
+ docile (~> 1.1.0)
118
+ multi_json (~> 1.0)
119
+ simplecov-html (~> 0.8.0)
120
+ simplecov-html (0.8.0)
121
+ sqlite3 (1.3.10)
122
+ term-ansicolor (1.3.0)
123
+ tins (~> 1.0)
124
+ thor (0.19.1)
125
+ thread_safe (0.3.4)
126
+ tins (1.3.3)
127
+ tzinfo (1.2.2)
128
+ thread_safe (~> 0.1)
129
+
130
+ PLATFORMS
131
+ ruby
132
+
133
+ DEPENDENCIES
134
+ actionmailer (~> 4.2.0)
135
+ appraisal
136
+ bundler
137
+ codeclimate-test-reporter
138
+ coveralls
139
+ minitest
140
+ minitest-rails
141
+ minitest-reporters
142
+ mocha
143
+ rake
144
+ random_unique_id!
145
+ shoulda
146
+ simplecov
147
+ sqlite3
@@ -43,7 +43,7 @@ module RandomUniqueId
43
43
  super.tap do
44
44
  if define_rid_method != false
45
45
  relationship_name = attrs[0]
46
- rel = reflections[relationship_name]
46
+ rel = reflections[relationship_name] || reflections[relationship_name.to_s]
47
47
 
48
48
  return if rel.options[:polymorphic] # If we don't know the class, we cannot find the record by rid.
49
49
 
@@ -2,5 +2,5 @@
2
2
  # Copyright © 2013, 2014, Watu
3
3
 
4
4
  module RandomUniqueId
5
- VERSION = "1.0.0"
5
+ VERSION = "1.0.1"
6
6
  end
@@ -10,9 +10,9 @@ Gem::Specification.new do |spec|
10
10
  spec.version = RandomUniqueId::VERSION
11
11
  spec.authors = ["J. Pablo Fernández"]
12
12
  spec.email = ["pupeno@watuapp.com"]
13
- spec.description = %q{Generate random but unique ids for your active record records.}
14
- spec.summary = %q{Generate random but unique ids for your active record records.}
15
13
  spec.homepage = "https://github.com/watu/random_unique_id"
14
+ spec.summary = %q{Generate random but unique ids for your active record records.}
15
+ spec.description = %q{Generate random but unique ids for your active record records.}
16
16
  spec.license = "MIT"
17
17
 
18
18
  spec.files = `git ls-files`.split($/)
@@ -26,6 +26,7 @@ Gem::Specification.new do |spec|
26
26
 
27
27
  spec.add_development_dependency "appraisal"
28
28
  spec.add_development_dependency "bundler"
29
+ spec.add_development_dependency "codeclimate-test-reporter"
29
30
  spec.add_development_dependency "coveralls" #, require: false
30
31
  spec.add_development_dependency "minitest"
31
32
  spec.add_development_dependency "minitest-reporters"
data/test/test_helper.rb CHANGED
@@ -10,6 +10,8 @@ SimpleCov.start do
10
10
  add_filter "/test/"
11
11
  end
12
12
  Coveralls.wear! # Comment out this line to have the local coverage generated.
13
+ require "codeclimate-test-reporter"
14
+ CodeClimate::TestReporter.start
13
15
 
14
16
  require "minitest/autorun"
15
17
  require "minitest/reporters"
@@ -34,3 +36,7 @@ ActiveRecord::Base.establish_connection(:sqlite3)
34
36
 
35
37
  # Shutup.
36
38
  I18n.enforce_available_locales = false # TODO: remove this line when it's not needed anymore.
39
+
40
+ if ActiveSupport::TestCase.respond_to? :test_order=
41
+ ActiveSupport::TestCase.test_order = :random
42
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: random_unique_id
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - J. Pablo Fernández
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-28 00:00:00.000000000 Z
11
+ date: 2014-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: codeclimate-test-reporter
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: coveralls
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -213,6 +227,8 @@ files:
213
227
  - gemfiles/rails_4_0.gemfile.lock
214
228
  - gemfiles/rails_4_1.gemfile
215
229
  - gemfiles/rails_4_1.gemfile.lock
230
+ - gemfiles/rails_4_2.gemfile
231
+ - gemfiles/rails_4_2.gemfile.lock
216
232
  - lib/random_unique_id.rb
217
233
  - lib/random_unique_id/util.rb
218
234
  - lib/random_unique_id/version.rb
@@ -240,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
240
256
  version: '0'
241
257
  requirements: []
242
258
  rubyforge_project:
243
- rubygems_version: 2.2.2
259
+ rubygems_version: 2.4.3
244
260
  signing_key:
245
261
  specification_version: 4
246
262
  summary: Generate random but unique ids for your active record records.