glebtv-carrierwave-mongoid 0.6.5 → 0.7.0

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: 1c88e0e0662ea059d12b9b6d8d6c692552ac4c25
4
- data.tar.gz: f145561e76ac5ddb30ba2c38d4f4dcdc548ed4de
3
+ metadata.gz: 5e1bca5dfb3392fd94d0b2a8e9f6bce23e6fbe28
4
+ data.tar.gz: 9b54fcc0f39bc7868eef019eac4f13526d676e46
5
5
  SHA512:
6
- metadata.gz: 1c079cfc4e0d55bb0e3336e3cf7f0171222ff803c99a55c4e6db18b4b89c82270976279fa2a9b10281bf25509e0e71fd67ff915f3c0843ce5b208c35207204b9
7
- data.tar.gz: 606aa75b38a400347eee1033a7685c745225bc3d2309bf06a39621ec4148650eb3695b26c591977e9f7f1758331013691c2ba663e1812dc23502e30c58af096c
6
+ metadata.gz: a0556f211d51b45f9fad88b21c2b1a5a2e831d406360a53879ef0aba9f6150f8ac194d4c17e7702aee0d04eb862b6d621310b9b30da78c281268056e282339e3
7
+ data.tar.gz: 71987c56d274d9179415f6b6714f166f1028806c8a3901293bdaf432704571c69a52d052a4f5cf6dc29395adc835f209d5b8194005aab2f99ecb0f4de18f8e5d
data/.travis.yml CHANGED
@@ -7,13 +7,5 @@ language: ruby
7
7
  rvm:
8
8
  - 1.9.3
9
9
  - 2.0.0
10
- - jruby-19mode
11
- - rbx-19mode
10
+ - 2.1.0
12
11
 
13
- gemfile:
14
- - Gemfile
15
- - gemfiles/carrierwave-0.8.gemfile
16
- - gemfiles/carrierwave-master.gemfile
17
- - gemfiles/mongoid-3.0.gemfile
18
- - gemfiles/mongoid-3.1.gemfile
19
- - gemfiles/mongoid-4.0.gemfile
data/Gemfile.lock CHANGED
@@ -1,55 +1,67 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- glebtv-carrierwave-mongoid (0.6.5)
5
- carrierwave (>= 0.8.0, < 0.10.0)
6
- mongoid (>= 3.0, < 5.0)
7
- mongoid (>= 3.0, < 5.0)
4
+ glebtv-carrierwave-mongoid (0.7.0)
5
+ carrierwave (~> 0.9.0)
6
+ mongoid (~> 4.0.0.alpha1)
8
7
 
9
8
  GEM
10
9
  remote: http://rubygems.org/
11
10
  specs:
12
- activemodel (3.2.15)
13
- activesupport (= 3.2.15)
14
- builder (~> 3.0.0)
15
- activesupport (3.2.15)
11
+ activemodel (4.0.3)
12
+ activesupport (= 4.0.3)
13
+ builder (~> 3.1.0)
14
+ activesupport (4.0.3)
16
15
  i18n (~> 0.6, >= 0.6.4)
17
- multi_json (~> 1.0)
18
- builder (3.0.4)
16
+ minitest (~> 4.2)
17
+ multi_json (~> 1.3)
18
+ thread_safe (~> 0.1)
19
+ tzinfo (~> 0.3.37)
20
+ atomic (1.1.14)
21
+ bson (2.2.0)
22
+ builder (3.1.4)
19
23
  carrierwave (0.9.0)
20
24
  activemodel (>= 3.2.0)
21
25
  activesupport (>= 3.2.0)
22
26
  json (>= 1.7)
23
- coderay (1.0.9)
24
- diff-lcs (1.2.4)
25
- i18n (0.6.5)
27
+ coderay (1.1.0)
28
+ connection_pool (1.2.0)
29
+ diff-lcs (1.2.5)
30
+ i18n (0.6.9)
26
31
  json (1.8.1)
27
32
  method_source (0.8.2)
28
- mini_magick (3.6.0)
33
+ mini_magick (3.7.0)
29
34
  subexec (~> 0.2.1)
30
- mongoid (3.1.5)
31
- activemodel (~> 3.2)
32
- moped (~> 1.4)
33
- origin (~> 1.0)
34
- tzinfo (~> 0.3.29)
35
- moped (1.5.1)
36
- multi_json (1.8.2)
37
- origin (1.1.0)
38
- pry (0.9.12.2)
39
- coderay (~> 1.0.5)
35
+ minitest (4.7.5)
36
+ mongoid (4.0.0.beta1)
37
+ activemodel (>= 4.0.0)
38
+ moped (~> 2.0.beta6)
39
+ origin (~> 2.1)
40
+ tzinfo (>= 0.3.37)
41
+ moped (2.0.0.beta6)
42
+ bson (~> 2.2)
43
+ connection_pool (~> 1.2)
44
+ optionable (~> 0.2.0)
45
+ multi_json (1.8.4)
46
+ optionable (0.2.0)
47
+ origin (2.1.0)
48
+ pry (0.9.12.6)
49
+ coderay (~> 1.0)
40
50
  method_source (~> 0.8)
41
51
  slop (~> 3.4)
42
- rake (10.1.0)
52
+ rake (10.1.1)
43
53
  rspec (2.14.1)
44
54
  rspec-core (~> 2.14.0)
45
55
  rspec-expectations (~> 2.14.0)
46
56
  rspec-mocks (~> 2.14.0)
47
- rspec-core (2.14.6)
48
- rspec-expectations (2.14.3)
57
+ rspec-core (2.14.7)
58
+ rspec-expectations (2.14.5)
49
59
  diff-lcs (>= 1.1.3, < 2.0)
50
- rspec-mocks (2.14.4)
51
- slop (3.4.6)
60
+ rspec-mocks (2.14.5)
61
+ slop (3.4.7)
52
62
  subexec (0.2.3)
63
+ thread_safe (0.1.3)
64
+ atomic
53
65
  tzinfo (0.3.38)
54
66
 
55
67
  PLATFORMS
@@ -59,5 +71,5 @@ DEPENDENCIES
59
71
  glebtv-carrierwave-mongoid!
60
72
  mini_magick
61
73
  pry
62
- rake (~> 10.0)
63
- rspec (~> 2.14)
74
+ rake
75
+ rspec
@@ -18,11 +18,11 @@ Gem::Specification.new do |s|
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_paths = ["lib"]
20
20
 
21
- s.add_dependency "mongoid", [">= 3.0", "< 5.0"]
22
- s.add_dependency "carrierwave", [">= 0.8.0", "< 0.10.0"]
23
- s.add_dependency "mongoid", [">= 3.0", "< 5.0"]
24
- s.add_development_dependency "rspec", ["~> 2.14"]
25
- s.add_development_dependency "rake", ["~> 10.0"]
21
+ s.add_dependency "mongoid", '~> 4.0.0.alpha1'
22
+ s.add_dependency "carrierwave", '~> 0.9.0'
23
+
24
+ s.add_development_dependency "rspec"
25
+ s.add_development_dependency "rake"
26
26
  s.add_development_dependency "mini_magick"
27
27
  s.add_development_dependency "pry"
28
28
  end
@@ -75,7 +75,11 @@ module CarrierWave
75
75
 
76
76
  def find_previous_model_for_#{column}
77
77
  if self.embedded?
78
- ancestors = [[ self.metadata.key, self._parent ]].tap { |x| x.unshift([ x.first.last.metadata.key, x.first.last._parent ]) while x.first.last.embedded? }
78
+ if self.respond_to?(:__metadata) # Mongoid >= 4.0.0.beta1
79
+ ancestors = [[ self.__metadata.key, self._parent ]].tap { |x| x.unshift([ x.first.last.__metadata.key, x.first.last._parent ]) while x.first.last.embedded? }
80
+ else # Mongoid < 4.0.0.beta1
81
+ ancestors = [[ self.metadata.key, self._parent ]].tap { |x| x.unshift([ x.first.last.metadata.key, x.first.last._parent ]) while x.first.last.embedded? }
82
+ end
79
83
  first_parent = ancestors.first.last
80
84
  reloaded_parent = first_parent.class.unscoped.find(first_parent.to_key.first)
81
85
  association = ancestors.inject(reloaded_parent) { |parent,(key,ancestor)| (parent.is_a?(Array) ? parent.find(ancestor.to_key.first) : parent).send(key) }
@@ -1,5 +1,5 @@
1
1
  module Carrierwave
2
2
  module Mongoid
3
- VERSION = "0.6.5"
3
+ VERSION = "0.7.0"
4
4
  end
5
5
  end
data/spec/mongoid_spec.rb CHANGED
@@ -547,7 +547,7 @@ describe CarrierWave::Mongoid do
547
547
 
548
548
  @class.class_eval do
549
549
  embeds_one :mongo_location
550
- default_scope where(:always_false => false)
550
+ default_scope -> { where(:always_false => false) }
551
551
  end
552
552
 
553
553
  @doc = @class.new
@@ -642,7 +642,7 @@ describe CarrierWave::Mongoid do
642
642
 
643
643
  @class.class_eval do
644
644
  embeds_many :mongo_locations
645
- default_scope where(:always_false => false)
645
+ default_scope -> { where(:always_false => false) }
646
646
  end
647
647
 
648
648
  @doc = @class.new
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glebtv-carrierwave-mongoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GlebTv
@@ -10,96 +10,64 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-10-29 00:00:00.000000000 Z
13
+ date: 2014-02-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mongoid
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - '>='
20
- - !ruby/object:Gem::Version
21
- version: '3.0'
22
- - - <
19
+ - - ~>
23
20
  - !ruby/object:Gem::Version
24
- version: '5.0'
21
+ version: 4.0.0.alpha1
25
22
  type: :runtime
26
23
  prerelease: false
27
24
  version_requirements: !ruby/object:Gem::Requirement
28
25
  requirements:
29
- - - '>='
30
- - !ruby/object:Gem::Version
31
- version: '3.0'
32
- - - <
26
+ - - ~>
33
27
  - !ruby/object:Gem::Version
34
- version: '5.0'
28
+ version: 4.0.0.alpha1
35
29
  - !ruby/object:Gem::Dependency
36
30
  name: carrierwave
37
31
  requirement: !ruby/object:Gem::Requirement
38
32
  requirements:
39
- - - '>='
40
- - !ruby/object:Gem::Version
41
- version: 0.8.0
42
- - - <
43
- - !ruby/object:Gem::Version
44
- version: 0.10.0
45
- type: :runtime
46
- prerelease: false
47
- version_requirements: !ruby/object:Gem::Requirement
48
- requirements:
49
- - - '>='
50
- - !ruby/object:Gem::Version
51
- version: 0.8.0
52
- - - <
53
- - !ruby/object:Gem::Version
54
- version: 0.10.0
55
- - !ruby/object:Gem::Dependency
56
- name: mongoid
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - '>='
60
- - !ruby/object:Gem::Version
61
- version: '3.0'
62
- - - <
33
+ - - ~>
63
34
  - !ruby/object:Gem::Version
64
- version: '5.0'
35
+ version: 0.9.0
65
36
  type: :runtime
66
37
  prerelease: false
67
38
  version_requirements: !ruby/object:Gem::Requirement
68
39
  requirements:
69
- - - '>='
70
- - !ruby/object:Gem::Version
71
- version: '3.0'
72
- - - <
40
+ - - ~>
73
41
  - !ruby/object:Gem::Version
74
- version: '5.0'
42
+ version: 0.9.0
75
43
  - !ruby/object:Gem::Dependency
76
44
  name: rspec
77
45
  requirement: !ruby/object:Gem::Requirement
78
46
  requirements:
79
- - - ~>
47
+ - - '>='
80
48
  - !ruby/object:Gem::Version
81
- version: '2.14'
49
+ version: '0'
82
50
  type: :development
83
51
  prerelease: false
84
52
  version_requirements: !ruby/object:Gem::Requirement
85
53
  requirements:
86
- - - ~>
54
+ - - '>='
87
55
  - !ruby/object:Gem::Version
88
- version: '2.14'
56
+ version: '0'
89
57
  - !ruby/object:Gem::Dependency
90
58
  name: rake
91
59
  requirement: !ruby/object:Gem::Requirement
92
60
  requirements:
93
- - - ~>
61
+ - - '>='
94
62
  - !ruby/object:Gem::Version
95
- version: '10.0'
63
+ version: '0'
96
64
  type: :development
97
65
  prerelease: false
98
66
  version_requirements: !ruby/object:Gem::Requirement
99
67
  requirements:
100
- - - ~>
68
+ - - '>='
101
69
  - !ruby/object:Gem::Version
102
- version: '10.0'
70
+ version: '0'
103
71
  - !ruby/object:Gem::Dependency
104
72
  name: mini_magick
105
73
  requirement: !ruby/object:Gem::Requirement
@@ -144,11 +112,6 @@ files:
144
112
  - LICENSE
145
113
  - README.md
146
114
  - Rakefile
147
- - gemfiles/carrierwave-0.8.gemfile
148
- - gemfiles/carrierwave-master.gemfile
149
- - gemfiles/mongoid-3.0.gemfile
150
- - gemfiles/mongoid-3.1.gemfile
151
- - gemfiles/mongoid-4.0.gemfile
152
115
  - glebtv-carrierwave-mongoid.gemspec
153
116
  - lib/carrierwave/mongoid.rb
154
117
  - lib/carrierwave/mongoid/version.rb
@@ -185,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
148
  version: '0'
186
149
  requirements: []
187
150
  rubyforge_project:
188
- rubygems_version: 2.1.10
151
+ rubygems_version: 2.2.1
189
152
  signing_key:
190
153
  specification_version: 4
191
154
  summary: This fork makes GridFS optional
@@ -1,5 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "carrierwave", "~> 0.8.0"
4
-
5
- gemspec path: "../"
@@ -1,5 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "carrierwave", github: "carrierwaveuploader/carrierwave", branch: "master"
4
-
5
- gemspec path: "../"
@@ -1,6 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "mongoid", github: "mongoid/mongoid", branch: "3.0.0-stable"
4
- gem "activemodel", "~> 3.2"
5
-
6
- gemspec path: "../"
@@ -1,5 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "mongoid", github: "mongoid/mongoid", branch: "3.1.0-stable"
4
-
5
- gemspec path: "../"
@@ -1,6 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "mongoid-grid_fs", github: "ahoward/mongoid-grid_fs", branch: "master"
4
- gem "mongoid", github: "mongoid/mongoid", branch: "master"
5
-
6
- gemspec path: "../"