polymorphic_integer_type 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MzliMzI1OWVkMzQ3NGI5YWRmNzgyYjgwYmZmMzdjZmJlNGE3ZmY3Nw==
5
- data.tar.gz: !binary |-
6
- MTc3MWM1MjQzMjQ3OTFhMzk2MDczN2I0ZDQ5MDE1ZThiZTgxOGVmZA==
2
+ SHA1:
3
+ metadata.gz: 3150bb1aade940d2d7bcc14f11346b94c9d0371a
4
+ data.tar.gz: a1f64074b2044039215457482bb86a25f01d41bb
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YzRjYzIwNTk4NmFlYmU2ZTEzMGFmNDRlMWFhYjVmOWY0MDEwNGJmMGVmNGU2
10
- YzA1NGYxMTBmN2M0YTZhZWI1YzAwN2UwNDgxNGJjMmMxYmI1ODhmOWY2MDYx
11
- MmM3MTRkZWVlOTgxZjMyYTcwMzU1NTBhNmU2YzlhZjVmYzUzZTQ=
12
- data.tar.gz: !binary |-
13
- YTIzYjA4NzcxMWZhOTUyYjg3OGEyMjQ3MTRhNGVlY2VlN2Y2MDI3YTc5ZjE2
14
- ZTU3MzBhYWY1MmI4NzNjMTI4NGMyYTM3YTllNmE3YjM5MzI1MTU3YTBhODNj
15
- ZDU5OWNlMmI2MjJiYjgzNDM3MGRhYWQ4ZTE5OTVhNjc0YWNlYTQ=
6
+ metadata.gz: e50a25927c9f53b06562122c1006a0659c8ba8eeefff14641d6b84f849d128ed6f416825837b06c1b22721653606ca6bb2be60dc66f512c54794d866f8a03b77
7
+ data.tar.gz: 2cff25efb18334cfd06db9cfc6f2c299738c559bd961db6386a73c49d42167a3ce481f3fde8e6c0f22e0cbbc37cf0fdea7692a8772ba609d88f6cdd1bc2ee616
@@ -48,7 +48,12 @@ module PolymorphicIntegerType
48
48
  options[:foreign_key] ||= "#{poly_type}_id"
49
49
  foreign_type = options.delete(:foreign_type) || "#{poly_type}_type"
50
50
  options[:conditions] ||= {}
51
- options[:conditions].merge!({foreign_type => klass_mapping.to_i})
51
+ if options[:conditions].is_a?(Array)
52
+ cond = options[:conditions].first
53
+ options[:conditions][0] = "(#{cond}) AND #{foreign_type}=#{klass_mapping.to_i}"
54
+ else
55
+ options[:conditions].merge!({foreign_type => klass_mapping.to_i})
56
+ end
52
57
  end
53
58
  end
54
59
 
@@ -1,3 +1,3 @@
1
1
  module PolymorphicIntegerType
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.6"
3
3
  end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polymorphic_integer_type
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle d'Oliveira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-12 00:00:00.000000000 Z
11
+ date: 2014-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.2'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
@@ -84,14 +84,14 @@ dependencies:
84
84
  name: debugger
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description: Allows the *_type field in the DB to be an integer rather than a string
@@ -101,7 +101,7 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
- - .gitignore
104
+ - ".gitignore"
105
105
  - Gemfile
106
106
  - LICENSE.txt
107
107
  - README.md
@@ -136,12 +136,12 @@ require_paths:
136
136
  - lib
137
137
  required_ruby_version: !ruby/object:Gem::Requirement
138
138
  requirements:
139
- - - ! '>='
139
+ - - ">="
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  requirements:
144
- - - ! '>='
144
+ - - ">="
145
145
  - !ruby/object:Gem::Version
146
146
  version: '0'
147
147
  requirements: []