lol_dba 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/Gemfile.lock +2 -2
- data/gemfiles/rails_3_2.gemfile.lock +1 -1
- data/gemfiles/rails_4_0.gemfile.lock +1 -1
- data/gemfiles/rails_4_1.gemfile.lock +1 -1
- data/gemfiles/rails_4_2.gemfile.lock +1 -1
- data/lib/lol_dba.rb +2 -2
- data/lib/lol_dba/version.rb +1 -1
- data/spec/fixtures/app/models/gift.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64685193735493e0cb8bc2e92a1dd9a81dfb6686
|
4
|
+
data.tar.gz: 02c3646cf50ca778443eeb2d5b8e64f0d5dfe42f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b01e27d6e9491c57246b0f99befef726c49815a57150503a6b83609f6c60208fb28f801826403dfc4ab34e1cbbc5f1d29b19906d0b658aa27fdc257699cfeb1
|
7
|
+
data.tar.gz: 21091f4b541976c2f8f5c3db9fd862a9a3ffc22218119907bde3bf95c8533570135c3e94b92f4d069a0ea31ab7543e774f5f0f1cf5c1f8753d72038a784a27ef
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
data/lib/lol_dba.rb
CHANGED
@@ -112,7 +112,7 @@ EOM
|
|
112
112
|
|
113
113
|
foreign_key = get_through_foreign_key(class_name, reflection_options)
|
114
114
|
|
115
|
-
index_name = [association_foreign_key, foreign_key].sort
|
115
|
+
index_name = [association_foreign_key, foreign_key].map(&:to_s).sort
|
116
116
|
when :has_many
|
117
117
|
# has_many tables are threaten by the other side of the relation
|
118
118
|
next unless reflection_options.options[:through] && reflections[reflection_options.options[:through].to_s]
|
@@ -131,7 +131,7 @@ EOM
|
|
131
131
|
|
132
132
|
#FIXME currently we don't support :through => :another_regular_has_many_and_non_through_relation
|
133
133
|
next if association_foreign_key.nil?
|
134
|
-
index_name = [association_foreign_key
|
134
|
+
index_name = [association_foreign_key, foreign_key].map(&:to_s).sort
|
135
135
|
end
|
136
136
|
|
137
137
|
unless index_name == "" || reflection_options.options.include?(:class)
|
data/lib/lol_dba/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class Gift < ActiveRecord::Base
|
2
2
|
|
3
3
|
self.primary_key = :custom_primary_key
|
4
|
-
has_and_belongs_to_many :users, :join_table => "purchases", :association_foreign_key =>
|
4
|
+
has_and_belongs_to_many :users, :join_table => "purchases", :association_foreign_key => :buyer_id, :foreign_key => 'present_id'
|
5
5
|
|
6
6
|
end
|