module DuckPuncher::Ducks::ActiveRecord::ClassMethods

Public Instance Methods

before(time) click to toggle source
# File lib/duck_puncher/ducks/active_record.rb, line 38
def before(time)
  scoped.where("#{quoted_table_name}.created_at < ?", time)
end
between(start_at, end_at) click to toggle source
# File lib/duck_puncher/ducks/active_record.rb, line 46
def between(start_at, end_at)
  scoped.where("#{quoted_table_name}.created_at BETWEEN ? AND ", start_at, end_at)
end
created_since(time)
Alias for: since
except_for(*ids) click to toggle source
# File lib/duck_puncher/ducks/active_record.rb, line 28
def except_for(*ids)
  scoped.where("#{quoted_table_name}.#{primary_key} NOT IN (?)", ids)
end
scoped() click to toggle source

shim for backwards compatibility with Rails 3

# File lib/duck_puncher/ducks/active_record.rb, line 51
def scoped
  where(nil)
end
since(time) click to toggle source
# File lib/duck_puncher/ducks/active_record.rb, line 32
def since(time)
  scoped.where("#{quoted_table_name}.created_at > ?", time)
end
Also aliased as: created_since
updated_since(time) click to toggle source
# File lib/duck_puncher/ducks/active_record.rb, line 42
def updated_since(time)
  scoped.where("#{quoted_table_name}.updated_at > ?", time)
end