Sha256: 37d3054d7736c8e598c0eff2368097df8cb402c701eb5553a7ab88e92284ba7a
Contents?: true
Size: 592 Bytes
Versions: 50
Compression:
Stored size: 592 Bytes
Contents
module Graphiti::Adapters::ActiveRecord::Inference # If going AR to AR, use AR introspection # If going AR to PORO, fall back to normal inference 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
50 entries across 50 versions & 1 rubygems