acts_as_importable 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.4.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{acts_as_importable}
8
- s.version = "0.4.0"
8
+ s.version = "0.4.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jagdeep Singh"]
12
- s.date = %q{2011-01-15}
12
+ s.date = %q{2011-01-17}
13
13
  s.description = %q{Use this gem to add import/export to .csv functionality to your activerecord models}
14
14
  s.email = %q{jagdeepkh@gmail.com}
15
15
  s.extra_rdoc_files = [
data/lib/import_export.rb CHANGED
@@ -45,10 +45,11 @@ module ModelMethods
45
45
  element.save!
46
46
  collection << element
47
47
  rescue Exception => e
48
- Rails.logger.error "Invalid data found at line #{index + 2} !!!"
49
- Rails.logger.error e.message
50
- Rails.logger.error e.backtrace.join("\n")
51
- raise e
48
+ e1 = e.exception("Invalid data found at line #{index + 2} : " + e.message)
49
+ e1.set_backtrace(e.backtrace)
50
+ Rails.logger.error e1.message
51
+ Rails.logger.error e1.backtrace.join("\n")
52
+ raise e1
52
53
  end
53
54
  end
54
55
  end
@@ -37,8 +37,7 @@ module ImportExport
37
37
  @new_objects = self.class.model_class.import(filename, context)
38
38
  flash[:notice] = "Import Successful - Imported #{@new_objects.length} #{self.class.model_class.name.underscore.humanize.pluralize}"
39
39
  rescue Exception => e
40
- logger.error "Error: Unable to process file. #{e}"
41
- flash[:error] = "Error: Unable to process file. #{e}"
40
+ logger.error flash[:error] = "Import Failed - No records imported due to errors. #{e}"
42
41
  ensure
43
42
  File.delete(filename)
44
43
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_importable
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 0
10
- version: 0.4.0
9
+ - 1
10
+ version: 0.4.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jagdeep Singh
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-15 00:00:00 +05:30
18
+ date: 2011-01-17 00:00:00 +05:30
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency