deferring 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/gemfiles/rails_42.gemfile +1 -1
- data/gemfiles/rails_42.gemfile.lock +1 -1
- data/gemfiles/rails_50.gemfile +1 -1
- data/gemfiles/rails_50.gemfile.lock +1 -1
- data/gemfiles/rails_51.gemfile +1 -1
- data/gemfiles/rails_51.gemfile.lock +1 -1
- data/gemfiles/rails_52.gemfile +1 -1
- data/gemfiles/rails_52.gemfile.lock +1 -1
- data/gemfiles/rails_60.gemfile +1 -1
- data/gemfiles/rails_60.gemfile.lock +1 -1
- data/lib/deferring/deferred_association.rb +1 -0
- data/lib/deferring/version.rb +1 -1
- data/spec/lib/deferring_habtm_spec.rb +13 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20c1b96db02679041590bd4fb7a68c2eb3528835c658e010b84f81adc508cddf
|
4
|
+
data.tar.gz: b8c4f6f2ca883c6e86a773e7540e89e423ed717013f4ef5d1cf9c32f6099bc8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68fbcfa58e42dc2544d76151903f1dadf4f792bdfbf8f76c0c1aacec2ebf7522cf6e9dc0af78f454a91410eb8009f96cb54ff15ea08cab27a597f273d5e2a89a
|
7
|
+
data.tar.gz: aba58381e1bed9dcdd90177c0e6820df8de418d980623ad0df2bd2dfa89543c5dceff01966b64e6f2f01162478a5d4d65c38ea9a05661d1382922a4947f35ab0
|
data/LICENSE.txt
CHANGED
data/gemfiles/rails_42.gemfile
CHANGED
data/gemfiles/rails_50.gemfile
CHANGED
data/gemfiles/rails_51.gemfile
CHANGED
data/gemfiles/rails_52.gemfile
CHANGED
data/gemfiles/rails_60.gemfile
CHANGED
@@ -47,6 +47,7 @@ module Deferring
|
|
47
47
|
# association.
|
48
48
|
delegate :[]=, :[], :clear, :select!, :reject!, :flatten, :flatten!, :sort!,
|
49
49
|
:keep_if, :delete_if, :sort_by!, :empty?, :size, :length,
|
50
|
+
:each_index,
|
50
51
|
to: :objects
|
51
52
|
|
52
53
|
# Delegates Ruby's Enumerable#find method to the original association.
|
data/lib/deferring/version.rb
CHANGED
@@ -377,6 +377,19 @@ RSpec.describe 'deferred has_and_belongs_to_many associations' do
|
|
377
377
|
end
|
378
378
|
end
|
379
379
|
|
380
|
+
describe 'supports methods from Ruby Array' do
|
381
|
+
describe '#each_index' do
|
382
|
+
it 'returns the index of each element in the association' do
|
383
|
+
bob.teams << dba << support
|
384
|
+
bob.save!
|
385
|
+
|
386
|
+
result = []
|
387
|
+
bob.teams.each_index { |i| result << i }
|
388
|
+
expect(result).to eq([0, 1])
|
389
|
+
end
|
390
|
+
end
|
391
|
+
end
|
392
|
+
|
380
393
|
describe 'enumerable methods that conflict with ActiveRecord' do
|
381
394
|
describe '#select' do
|
382
395
|
before do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deferring
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robin Roestenburg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|