has_many_polymorphic 0.7.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -102,7 +102,7 @@ module RussellEdge #:nodoc:
102
102
  #handle STI get superclass class_name if not sub class of ActiveRecord::Base
103
103
  klass_name = (reln_record.class.superclass == ActiveRecord::Base) ? reln_record.class.name : reln_record.class.superclass.name
104
104
  conditions = "#{name.to_s.singularize}_id = #{reln_record.id} and #{name.to_s.singularize}_type = '#{klass_name}'"
105
- exisiting_record = record.send("#{options[:through]}").find(:first,:conditions => conditions)
105
+ exisiting_record = record.send("#{options[:through]}").where(conditions).first
106
106
 
107
107
  if exisiting_record.nil?
108
108
  values_hash = {}
@@ -1,3 +1,3 @@
1
1
  module HasManyPolymorphic
2
- VERSION = '0.7.0' unless defined?(::HasManyPolymorphic::VERSION)
2
+ VERSION = '1.0.0' unless defined?(::HasManyPolymorphic::VERSION)
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_many_polymorphic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 1.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-28 00:00:00.000000000 Z
12
+ date: 2012-02-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &27073632 !ruby/object:Gem::Requirement
16
+ requirement: &26877024 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *27073632
24
+ version_requirements: *26877024
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec-rails
27
- requirement: &27058572 !ruby/object:Gem::Requirement
27
+ requirement: &26861964 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '2.7'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *27058572
35
+ version_requirements: *26861964
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: sqlite3
38
- requirement: &27059820 !ruby/object:Gem::Requirement
38
+ requirement: &26863212 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.3.4
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *27059820
46
+ version_requirements: *26863212
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: simplecov
49
- requirement: &27064020 !ruby/object:Gem::Requirement
49
+ requirement: &26867412 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0.5'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *27064020
57
+ version_requirements: *26867412
58
58
  description: Simple replacement for has_many_polymorphs
59
59
  email: russonrails@gmail.com
60
60
  executables: []