Sha256: 36810af1deab92a7b4c51e13208f7279224474dee463093d35bade261f1840b3

Contents?: true

Size: 733 Bytes

Versions: 10

Compression:

Stored size: 733 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/feeds"

module Renalware
  module Feeds
    module Files
      module PracticeMemberships
        class ImportCSV
          pattr_initialize :csv_path

          def call
            import_practice_memberships_csv_using_sql_function
          end

          private

          # See migration for SQL function definition
          def import_practice_memberships_csv_using_sql_function
            conn = ActiveRecord::Base.connection
            conn.execute(
              "SELECT renalware.import_practice_memberships_csv(
                #{conn.quote(csv_path.realpath.to_s)}::text
              )"
            )
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/models/renalware/feeds/files/practice_memberships/import_csv.rb
renalware-core-2.1.0 app/models/renalware/feeds/files/practice_memberships/import_csv.rb
renalware-core-2.0.167 app/models/renalware/feeds/files/practice_memberships/import_csv.rb
renalware-core-2.0.166 app/models/renalware/feeds/files/practice_memberships/import_csv.rb
renalware-core-2.0.165 app/models/renalware/feeds/files/practice_memberships/import_csv.rb
renalware-core-2.0.164 app/models/renalware/feeds/files/practice_memberships/import_csv.rb
renalware-core-2.0.163 app/models/renalware/feeds/files/practice_memberships/import_csv.rb
renalware-core-2.0.162 app/models/renalware/feeds/files/practice_memberships/import_csv.rb
renalware-core-2.0.161 app/models/renalware/feeds/files/practice_memberships/import_csv.rb
renalware-core-2.0.160 app/models/renalware/feeds/files/practice_memberships/import_csv.rb