Sha256: 065cda0a1daba352523837bdc74fdf7c774b1051191731e8c5d71b1088dd5fec
Contents?: true
Size: 344 Bytes
Versions: 5
Compression:
Stored size: 344 Bytes
Contents
module Ddr module Models module HasChildren def first_child child_class = self.class.reflect_on_association(:children).klass solr_field = child_class.reflect_on_association(:parent).solr_key child_class.where(solr_field => id).order("#{Ddr::Index::Fields::LOCAL_ID} ASC").first end end end end
Version data entries
5 entries across 5 versions & 1 rubygems