sql.rb 278 Bytes Edit Raw Blame History 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 module Noosfero module SQL class << self def random_function() default = 'random()' adapter = ActiveRecord::Base.configurations[Rails.env]['adapter'] { 'mysql' => 'rand()' }[adapter] || default end end end end