Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date Value Formatting #5

Closed
wants to merge 2 commits into from
Closed
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
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ gemspec
group :test do group :test do
gem 'rspec', '~>1.0', :require => %w(spec) gem 'rspec', '~>1.0', :require => %w(spec)
gem 'rake' gem 'rake'
gem 'rcov' gem 'rcov', :platforms => :ruby_18


gem 'ruby-debug', :platforms => :ruby_18 gem 'ruby-debug', :platforms => :ruby_18
gem 'ruby-debug19', :platforms => :ruby_19 gem 'ruby-debug19', :platforms => :ruby_19


gem 'bundler', '~> 1.0.0' gem 'bundler', '~> 1.1.0'
gem 'ParseTree', :require => 'parse_tree' gem 'ParseTree', :require => 'parse_tree'
gem 'dm-sweatshop' gem 'dm-sweatshop'
gem 'dm-sqlite-adapter' gem 'dm-sqlite-adapter'
Expand Down
2 changes: 2 additions & 0 deletions lib/dm-salesforce-adapter/sql.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ def quote_value(value, property)
when Array then "(#{value.map {|v| quote_value(v, property)}.join(", ")})" when Array then "(#{value.map {|v| quote_value(v, property)}.join(", ")})"
when NilClass then "NULL" when NilClass then "NULL"
when String then "'#{value.gsub(/'/, "\\'").gsub(/\\/, %{\\\\})}'" when String then "'#{value.gsub(/'/, "\\'").gsub(/\\/, %{\\\\})}'"
when Date then value.iso8601
when DateTime, Time then value.iso8601(2)
else "#{value}" else "#{value}"
end end
end end
Expand Down