idata 0.1.2 → 0.1.3
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.
- checksums.yaml +4 -4
- data/bin/iexport +8 -1
- data/lib/idata/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 521f9181a3c63dbe51c67763b06cb8469c0daf2d
|
|
4
|
+
data.tar.gz: dade0d4c7350811ad3270298cd18ed2c3213ba9c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 52d9d927c5c2543c906652fbd38bab4d503cb97650b8e1f7b542e54ca1c99fddfe4a7f4307ddba2e98f257f1f00f0eba11d4be519c9a44322a6ea0a1261e1a98
|
|
7
|
+
data.tar.gz: 5b2a0c7f48ad547ede412525dfadfe885557a984315c1cb58cfe6eead69cd5d35d080765a120cc7cd8e44eecdce1ecd3ac5f3c04d6b179bce41abb059430f6b7
|
data/bin/iexport
CHANGED
|
@@ -180,7 +180,14 @@ end
|
|
|
180
180
|
|
|
181
181
|
CSV.open($options[:output], "wb", :quote_char => $options[:quote_char], :col_sep => $options[:delim], :row_sep => $options[:linebreak], :force_quotes => $options[:quotes]) do |csv|
|
|
182
182
|
scope = Product.select($options[:select]).where($options[:where])
|
|
183
|
-
|
|
183
|
+
first = scope.first
|
|
184
|
+
|
|
185
|
+
if first
|
|
186
|
+
csv << first.attributes.keys if $options[:headers]
|
|
187
|
+
else
|
|
188
|
+
# only use .column_names when table is empty, to ensure fields match values
|
|
189
|
+
csv << Product.column_names if $options[:headers]
|
|
190
|
+
end
|
|
184
191
|
|
|
185
192
|
scope.each do |item|
|
|
186
193
|
attrs = item.attributes.values
|
data/lib/idata/version.rb
CHANGED