Skip to content

Commit

Permalink
Change file to be imported to MS-Excel format
Browse files Browse the repository at this point in the history
Spreadsheet gem only supports MS-Excel as per described:
https://github.com/zdavatz/spreadsheet#description
  • Loading branch information
luilver committed Nov 7, 2020
1 parent 9804bbb commit 06f29f0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,4 @@ gem "devise-encryptable"
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
gem 'activejob', '~> 5.2.0'
gem 'ransack_ui', path: 'vendor/gems/ransack_ui-1.3.4' # Vendored until our fix is merged and released
gem 'spreadsheet'
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ GEM
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
ruby-ole (1.2.12.2)
ruby-progressbar (1.10.1)
rubyzip (2.3.0)
sass (3.7.4)
Expand All @@ -359,6 +360,8 @@ GEM
sixarm_ruby_unaccent (1.2.0)
sort_alphabetical (1.1.0)
unicode_utils (>= 1.2.2)
spreadsheet (1.2.6)
ruby-ole (>= 1.0)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
Expand Down Expand Up @@ -470,6 +473,7 @@ DEPENDENCIES
select2-rails
selenium-webdriver
simple_form
spreadsheet
sprockets-rails (>= 3.0.0)
sqlite3 (~> 1.3.13)
therubyracer
Expand Down
2 changes: 1 addition & 1 deletion app/models/files/imported_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def generate_md5sum
private

def filetype
valid = File.open(filename).type_from_file_command == "text/xml" rescue ""
valid = File.open(filename).type_from_file_command == "application/vnd.ms-excel" rescue ""
if valid == ""
errors.add(:filename, "no such file")
end
Expand Down

0 comments on commit 06f29f0

Please sign in to comment.