Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion comma.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Gem::Specification.new do |s|

s.licenses = ['MIT']

s.add_dependency 'activesupport', ['>= 4.2.0', '< 6.1']
s.add_dependency 'activesupport', ['>= 4.2.0', '< 9']

s.add_development_dependency 'appraisal', ['~> 1.0.0']
s.add_development_dependency 'rake', ['~> 10.5.0']
Expand Down
2 changes: 1 addition & 1 deletion lib/comma/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def run(iterator_method)
def append_csv(csv, iterator_method)
return '' if @instance.empty?

csv << @instance.first.to_comma_headers(@style, @globals) unless
csv << @instance.take(1).first.to_comma_headers(@style, @globals) unless
@options.key?(:write_headers) && !@options[:write_headers]
@instance.send(iterator_method) do |object|
csv << object.to_comma(@style, @sanitized, @globals)
Expand Down
7 changes: 6 additions & 1 deletion lib/comma/sanitized_extractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ def starts_with_special_characters(result)
end

def sanitize_result(result)
result = result.to_s
if result.is_a?(ActiveSupport::TimeWithZone)
result = result.to_fs
else
result = result.to_s
end

if starts_with_special_characters(result)
if check_for_only_digits(result)
result
Expand Down
2 changes: 1 addition & 1 deletion lib/comma/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Comma
VERSION = '4.3.2'
VERSION = '4.3.3'
end