Module: WithoutScope::QuotedColumnConditions

Defined in:
lib/acts_as_revisable/quoted_columns.rb

Overview

This module is more about the pretty than anything else. This allows you to use symbols for column names in a conditions hash.

User.find(:all, :conditions => ["? = ?", :name, "sam"])

Would generate:

select * from users where "users"."name" = 'sam'

This is consistent with Rails and Ruby where symbols are used to represent methods. Only a symbol matching a column name will trigger this beavior.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



14
15
16
# File 'lib/acts_as_revisable/quoted_columns.rb', line 14

def self.included(base)
  base.send(:extend, ClassMethods)
end