Sha256: e9cca40162c95059b927f3e731cbe7cabb8c8fa5655a8ea6ece464800bd567ce
Contents?: true
Size: 1.16 KB
Versions: 2
Compression:
Stored size: 1.16 KB
Contents
require 'thecore_background_jobs' # This brings backend commons also. # Rails require 'serviceworker-rails' require "groupdate" require "apexcharts" require 'concerns/thecore_ui_commons_user' # require 'helpers/thecore_ui_commons_helper' # require 'helpers/charts_helper' require "thecore_ui_commons/engine" module ThecoreUiCommons # Your code goes here... def self.save_files files # Rails.logger.debug "AAAAAAAAAAA: POST?" files.each do |pic| # Rails.logger.debug "AAAAAAAAAAA: EACH PIC: #{pic.inspect}" upload_dir = Rails.root.join(Settings.ns(:importer).import_from_folder, 'uploads') FileUtils.mkdir_p upload_dir # Rails.logger.debug "AAAAAAAAAAA: Fatto MKDIR di #{upload_dir}" file_to_upload = Rails.root.join(upload_dir, "uploaded-#{Time.now.strftime("%Y%m%d%H%M%S%L")}-#{pic.original_filename}") # Rails.logger.debug "AAAAAAAAAAA: File da uploadare #{file_to_upload}" File.open(file_to_upload, 'wb') do |file| # Rails.logger.debug "AAAAAAAAAAAAAAAAAA: Dentro alla scrittura" file.write(pic.read) end if Regexp.new("\\.#{Settings.ns(:importer).extension.gsub(/ +/, "").split(",").join("|\\.")}$").match? pic.original_filename end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
thecore_ui_commons-2.2.6 | lib/thecore_ui_commons.rb |
thecore_ui_commons-2.2.5 | lib/thecore_ui_commons.rb |