Sha256: 90f2e1b70bdda247ca4b886bcbb5442afc99267b09671dfa6ffa0a20ff82552c
Contents?: true
Size: 844 Bytes
Versions: 3
Compression:
Stored size: 844 Bytes
Contents
# encoding: utf-8 module EdgeRider module Util extend self def qualify_column_name(model, column_name) column_name = column_name.to_s unless column_name.include?('.') quoted_table_name = model.connection.quote_table_name(model.table_name) quoted_column_name = model.connection.quote_column_name(column_name) column_name = "#{quoted_table_name}.#{quoted_column_name}" end column_name end def exclusive_query(model, conditions) if activerecord2? model.send(:with_exclusive_scope) do model.scoped(:conditions => conditions) end else model.unscoped.where(conditions) end end def scope?(object) object.respond_to?(:scoped) end def activerecord2? ActiveRecord::VERSION::MAJOR < 3 end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
edge_rider-0.2.5 | lib/edge_rider/util.rb |
edge_rider-0.2.4 | lib/edge_rider/util.rb |
edge_rider-0.2.3 | lib/edge_rider/util.rb |