csv_row_model 0.3.9 → 0.3.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 88996e6f325312a03db0b5b768966b1d72af85b1
4
- data.tar.gz: cfa64420a9b1cad6f41a21cd146becdf5e23043e
3
+ metadata.gz: c16a446fafcc7457fffac11919745acfa9f283cd
4
+ data.tar.gz: ea6cdbed5009681cc3a8b92452f5b94bfc722640
5
5
  SHA512:
6
- metadata.gz: dec92015befb15217ceb8e75da597418e75006d78970c8ad5a8fdfea486d8b93cede95cb94e57ce665f47f3ef6c76064c1201b2040deefe115c775031c8ae9c6
7
- data.tar.gz: 747aa6f33666effdd354ac8ebba508fd2714d25226e355153da4048e4e9926a5c79d59f2b92f44ac06d79d5c203f3d9266d49a4d922b3023ab8b7783767ee16f
6
+ metadata.gz: 6d3e8e9b72a3614bfe036917d2f724802ed8c1f9f42b0013273f761a6b9d850075ff52c2744c520b5a9159410fc99f9d87be15c12d4d614b9938feabf47c0dcf
7
+ data.tar.gz: 49ab3a6bfbb1b34c293fb309b1f5cea4ea694ec667884ce39334e9d247dad7f51a867f728a1abe451c0b25f3de5a8d6625b2a602d35ba6e08d4afd9f5dd80d23
@@ -12,7 +12,7 @@ module CsvRowModel
12
12
  super.flatten
13
13
  end
14
14
 
15
- # See Model::Columns#formatted_attributes
15
+ # See Model::Export#formatted_attributes
16
16
  def formatted_attributes
17
17
  super.merge(formatted_attributes_from_column_names(self.class.dynamic_column_names))
18
18
  end
@@ -14,7 +14,7 @@ module CsvRowModel
14
14
 
15
15
  # @return [Array] dynamic_column row data
16
16
  def dynamic_source_row
17
- source_row[self.class.columns.size..-1]
17
+ self.class.dynamic_columns? ? source_row[self.class.columns.size..-1] : []
18
18
  end
19
19
 
20
20
  # @return [Hash] a map of `column_name => original_attribute(column_name)`
@@ -53,7 +53,7 @@ module CsvRowModel
53
53
  end
54
54
  # @return [Array] dynamic_column headers
55
55
  def dynamic_source_headers(source_header)
56
- source_header[columns.size..-1]
56
+ dynamic_columns? ? source_header[columns.size..-1] : []
57
57
  end
58
58
 
59
59
  protected
@@ -13,6 +13,10 @@ module CsvRowModel
13
13
  end
14
14
 
15
15
  class_methods do
16
+ def dynamic_columns?
17
+ dynamic_columns.present?
18
+ end
19
+
16
20
  def is_dynamic_column?(column_name)
17
21
  dynamic_columns.keys.include?(column_name)
18
22
  end
@@ -1,3 +1,3 @@
1
1
  module CsvRowModel
2
- VERSION = "0.3.9"
2
+ VERSION = "0.3.10"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csv_row_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Chung
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-02-19 00:00:00.000000000 Z
12
+ date: 2016-04-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
@@ -49,8 +49,6 @@ extra_rdoc_files: []
49
49
  files:
50
50
  - ".gitignore"
51
51
  - ".rspec"
52
- - ".ruby-gemset"
53
- - ".ruby-version"
54
52
  - ".travis.yml"
55
53
  - ".yardopts"
56
54
  - CONTRIBUTING.md
@@ -115,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
113
  version: '0'
116
114
  requirements: []
117
115
  rubyforge_project:
118
- rubygems_version: 2.4.6
116
+ rubygems_version: 2.5.1
119
117
  signing_key:
120
118
  specification_version: 4
121
119
  summary: Import and export your custom CSVs with a intuitive shared Ruby interface.
data/.ruby-gemset DELETED
@@ -1 +0,0 @@
1
- csv_row_model
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 2.2.2