Sha256: 69425f3c5d0281088bae7674589d370d1f131a34e8517d2eac55c8a961f5d687
Contents?: true
Size: 599 Bytes
Versions: 5
Compression:
Stored size: 599 Bytes
Contents
module Lanes module Concerns # A collection of handly utility methods to generate queries module Queries extend ActiveSupport::Concern module ClassMethods def compose_query_using_detail_view( view: nil, join_to: nil ) join_to = "#{table_name.singularize}_#{primary_key}" unless join_to joins("join #{view} as details on details.#{join_to} = #{table_name}.#{primary_key}") .select("#{table_name}.*, details.*") end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems