module Repor
Constants
- VERSION
Public Class Methods
database_type()
click to toggle source
# File lib/repor.rb, line 2 def self.database_type database_adapter_name = ActiveRecord::Base.connection_config[:adapter] case database_adapter_name when /postgres/ then :postgres when /mysql/ then :mysql when /sqlite/ then :sqlite else raise "unsupported database #{database_adapter_name}" end end
numeric?(value)
click to toggle source
# File lib/repor.rb, line 13 def self.numeric?(value) value.is_a?(Numeric) || value.is_a?(String) && value =~ /\A\d+(?:\.\d+)?\z/ end