copious-activerecord-activesalesforce-adapter 2.2.4 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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}")
|