mongoid 2.1.6 → 2.1.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,18 +26,6 @@ module Mongoid # :nodoc:
26
26
  end
27
27
  end
28
28
 
29
- # This substituable does not clone.
30
- #
31
- # @example Get the substitutable.
32
- # proxy.substitutable
33
- #
34
- # @return [ Object ] The target.
35
- #
36
- # @since 2.1.6
37
- def substitutable
38
- target
39
- end
40
-
41
29
  # Substitutes the supplied target documents for the existing document
42
30
  # in the relation.
43
31
  #
@@ -505,7 +505,7 @@ module Mongoid # :nodoc:
505
505
  #
506
506
  # @since 2.1.6
507
507
  def many?
508
- @many ||= relation.macro =~ /many/
508
+ @many ||= (relation.macro.to_s =~ /many/)
509
509
  end
510
510
 
511
511
  # Returns the macro for the relation of this metadata.
@@ -45,7 +45,7 @@ module Mongoid # :nodoc:
45
45
  #
46
46
  # @since 2.1.6
47
47
  def substitutable
48
- target.clone
48
+ target
49
49
  end
50
50
 
51
51
  protected
@@ -25,18 +25,6 @@ module Mongoid # :nodoc:
25
25
  end
26
26
  end
27
27
 
28
- # This substituable does not clone.
29
- #
30
- # @example Get the substitutable.
31
- # proxy.substitutable
32
- #
33
- # @return [ Object ] The target.
34
- #
35
- # @since 2.1.6
36
- def substitutable
37
- target
38
- end
39
-
40
28
  # Substitutes the supplied target documents for the existing document
41
29
  # in the relation.
42
30
  #
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Mongoid #:nodoc
3
- VERSION = "2.1.6"
3
+ VERSION = "2.1.7"
4
4
  end
@@ -16,10 +16,13 @@ module Rails #:nodoc:
16
16
  # @since 2.1.0
17
17
  def create_indexes(pattern)
18
18
  Dir.glob(pattern).each do |file|
19
- model = determine_model(file)
20
- if model
21
- Logger.new($stdout).info("Generating indexes for #{model}")
22
- model.create_indexes
19
+ begin
20
+ model = determine_model(file)
21
+ if model
22
+ model.create_indexes
23
+ Logger.new($stdout).info("Generated indexes for #{model}")
24
+ end
25
+ rescue => e
23
26
  end
24
27
  end
25
28
  end
@@ -68,12 +71,9 @@ module Rails #:nodoc:
68
71
  # @since 2.1.0
69
72
  def determine_model(file)
70
73
  model_path = file[0..-4].split('/')[2..-1]
71
- begin
72
- klass = model_path.map { |path| path.camelize }.join('::').constantize
73
- if klass.ancestors.include?(::Mongoid::Document) && !klass.embedded
74
- return klass
75
- end
76
- rescue => e
74
+ klass = model_path.map { |path| path.camelize }.join('::').constantize
75
+ if klass.ancestors.include?(::Mongoid::Document) && !klass.embedded
76
+ return klass
77
77
  end
78
78
  end
79
79
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.6
4
+ version: 2.1.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-08-08 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
16
- requirement: &70184069667540 !ruby/object:Gem::Requirement
16
+ requirement: &70273131511360 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70184069667540
24
+ version_requirements: *70273131511360
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: tzinfo
27
- requirement: &70184069666660 !ruby/object:Gem::Requirement
27
+ requirement: &70273131510360 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.3.22
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70184069666660
35
+ version_requirements: *70273131510360
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: mongo
38
- requirement: &70184069665680 !ruby/object:Gem::Requirement
38
+ requirement: &70273131509340 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '1.3'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70184069665680
46
+ version_requirements: *70273131509340
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rdoc
49
- requirement: &70184069664720 !ruby/object:Gem::Requirement
49
+ requirement: &70273131507880 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 3.5.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70184069664720
57
+ version_requirements: *70273131507880
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: bson_ext
60
- requirement: &70184069663720 !ruby/object:Gem::Requirement
60
+ requirement: &70273131506780 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '1.3'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70184069663720
68
+ version_requirements: *70273131506780
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: mocha
71
- requirement: &70184069662540 !ruby/object:Gem::Requirement
71
+ requirement: &70273131505780 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 0.9.8
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70184069662540
79
+ version_requirements: *70273131505780
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rspec
82
- requirement: &70184069661380 !ruby/object:Gem::Requirement
82
+ requirement: &70273131504680 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '2.6'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70184069661380
90
+ version_requirements: *70273131504680
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: watchr
93
- requirement: &70184069660280 !ruby/object:Gem::Requirement
93
+ requirement: &70273131503420 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,7 +98,7 @@ dependencies:
98
98
  version: '0.6'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *70184069660280
101
+ version_requirements: *70273131503420
102
102
  description: Mongoid is an ODM (Object Document Mapper) Framework for MongoDB, written
103
103
  in Ruby.
104
104
  email:
@@ -379,7 +379,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
379
379
  version: '0'
380
380
  segments:
381
381
  - 0
382
- hash: -4360740221674892894
382
+ hash: 1942003466087624126
383
383
  required_rubygems_version: !ruby/object:Gem::Requirement
384
384
  none: false
385
385
  requirements: