Sha256: 40b586a2da25819df9b3e3059143e0f8057caa44df13a6e928a382e703ab0474

Contents?: true

Size: 234 Bytes

Versions: 6

Compression:

Stored size: 234 Bytes

Contents

class Array
  def to_sql_values
    tmp = self.map do |elem|
      if elem.nil?
        'NULL'
      else
        "'#{elem}'"
      end
    end
    "#{tmp.join(', ')}"
  end

  def to_sql_columns
    "`#{self.join('`, `')}`"
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
active_record_auditor-0.2.1 lib/active_record_auditor/extensions/array.rb
active_record_auditor-0.2.0 lib/active_record_auditor/extensions/array.rb
active_record_auditor-0.1.9 lib/active_record_auditor/extensions/array.rb
active_record_auditor-0.1.8 lib/active_record_auditor/extensions/array.rb
active_record_auditor-0.1.7 lib/active_record_auditor/extensions/array.rb
active_record_auditor-0.1.6 lib/active_record_auditor/extensions/array.rb