data_miner 2.5.1 → 2.5.2

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/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ 2.5.2 / 2013-07-05
2
+
3
+ * Bug fixes
4
+
5
+ * Get connection from the right connection pool (namely, the model's, not AR::Base's)
6
+
1
7
  2.5.1 / 2013-03-15
2
8
 
3
9
  * Enhancements
@@ -383,7 +383,7 @@ class DataMiner
383
383
 
384
384
  def read_units(row)
385
385
  if units = row[units_field_name || units_field_number]
386
- DataMiner.compress_whitespace(units).underscore.to_sym
386
+ DataMiner.compress_whitespace(units).underscore
387
387
  end
388
388
  end
389
389
 
@@ -102,7 +102,7 @@ class DataMiner
102
102
  end
103
103
 
104
104
  def save_with_upsert
105
- c = ActiveRecord::Base.connection_pool.checkout
105
+ c = model.connection_pool.checkout
106
106
  Upsert.stream(c, model.table_name) do |upsert|
107
107
  table.each do |row|
108
108
  selector = @key ? { @key => attributes[@key].read(row) } : { model.primary_key => nil }
@@ -113,7 +113,7 @@ class DataMiner
113
113
  upsert.row selector, document
114
114
  end
115
115
  end
116
- ActiveRecord::Base.connection_pool.checkin c
116
+ model.connection_pool.checkin c
117
117
  end
118
118
 
119
119
  def save_with_activerecord
@@ -126,7 +126,7 @@ class DataMiner
126
126
 
127
127
  def table_has_autoincrementing_primary_key?
128
128
  return @table_has_autoincrementing_primary_key_query.first if @table_has_autoincrementing_primary_key_query.is_a?(Array)
129
- c = ActiveRecord::Base.connection_pool.checkout
129
+ c = model.connection_pool.checkout
130
130
  answer = if (pk = model.primary_key) and model.columns_hash[pk].type == :integer
131
131
  case c.adapter_name
132
132
  when /mysql/i
@@ -142,7 +142,7 @@ class DataMiner
142
142
  true
143
143
  end
144
144
  end
145
- ActiveRecord::Base.connection_pool.checkin c
145
+ model.connection_pool.checkin c
146
146
  @table_has_autoincrementing_primary_key_query = [answer]
147
147
  answer
148
148
  end
@@ -40,9 +40,7 @@ class DataMiner
40
40
  # @private
41
41
  def start
42
42
  if statement
43
- c = ActiveRecord::Base.connection_pool.checkout
44
- c.execute statement
45
- ActiveRecord::Base.connection_pool.checkin c
43
+ ActiveRecord::Base.connection.execute statement
46
44
  else
47
45
  tmp_path = UnixUtils.curl url
48
46
  send config[:adapter], tmp_path
@@ -1,3 +1,3 @@
1
1
  class DataMiner
2
- VERSION = '2.5.1'
2
+ VERSION = '2.5.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_miner
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 2.5.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2013-03-15 00:00:00.000000000 Z
16
+ date: 2013-07-05 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: aasm