Sha256: a8d0f7073d0d69974ba2192d078584b1e463d71075b72a93d26c703cef0ef254

Contents?: true

Size: 579 Bytes

Versions: 1

Compression:

Stored size: 579 Bytes

Contents

module Skr
    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: view, join_to: join_to )
                    view = Skr::Core.config.table_prefix + view.to_s
                    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

1 entries across 1 versions & 1 rubygems

Version Path
stockor-core-0.2 lib/skr/concerns/queries.rb