Sha256: cb1a99c4490b5e2fa0658f0dfd91b6b178675e16996fdb41784726ae3cb3a3ce
Contents?: true
Size: 594 Bytes
Versions: 32
Compression:
Stored size: 594 Bytes
Contents
module Graphiti::Adapters::ActiveRecord::Inferrence # If going AR to AR, use AR introspection # If going AR to PORO, fall back to normal inferrence def infer_foreign_key parent_model = parent_resource_class.model reflection = parent_model.reflections[association_name.to_s] if reflection reflection = proper_reflection(reflection) reflection.foreign_key.to_sym else super end end private def proper_reflection(reflection) if (thru = reflection.through_reflection) proper_reflection(thru) else reflection end end end
Version data entries
32 entries across 32 versions & 1 rubygems