Sha256: c6b52384d6b1174dfd2083c8e50d4b14d037119aca4201222be8f98226b85a84
Contents?: true
Size: 742 Bytes
Versions: 17
Compression:
Stored size: 742 Bytes
Contents
require_dependency "renalware/feeds" require "attr_extras" module Renalware module Feeds module Files module Practices class ImportCSV pattr_initialize :csv_path def call Rails.logger.info("Importing CSV file #{csv_path}...") import_practices_csv_using_sql_function Rails.logger.info("... done") end private # See migration for SQL function definition def import_practices_csv_using_sql_function conn = ActiveRecord::Base.connection conn.execute( "SELECT import_practices_csv(#{conn.quote(csv_path.realpath.to_s)})" ) end end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems