copious-activerecord-activesalesforce-adapter 2.2.4 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -708,9 +708,11 @@ module ActiveRecord
|
|
708
708
|
|
709
709
|
if referenced_klass
|
710
710
|
if one_to_many
|
711
|
-
|
711
|
+
assoc_name = reference_to.underscore.pluralize.to_sym
|
712
|
+
klass.has_many assoc_name, :class_name => referenced_klass.name, :foreign_key => foreign_key
|
712
713
|
else
|
713
|
-
|
714
|
+
assoc_name = reference_to.underscore.singularize.to_sym
|
715
|
+
klass.belongs_to assoc_name, :class_name => referenced_klass.name, :foreign_key => foreign_key
|
714
716
|
end
|
715
717
|
|
716
718
|
debug(" Created one-to-#{one_to_many ? 'many' : 'one' } relationship '#{referenceName}' from #{klass} to #{referenced_klass} using #{foreign_key}")
|