Sha256: b05a914f494591a461aecbb18be65121c3b7906c8f2dbf50e9658a48d4c03e8b

Contents?: true

Size: 420 Bytes

Versions: 1

Compression:

Stored size: 420 Bytes

Contents

module Shared
  def conditions_for_range(start_time, end_time, field=nil)
    field = "#{table_name}.#{field}" if field
    field ||= by_star_field
    ["#{field} >= ? AND #{field} <= ?", start_time.utc, end_time.utc]
  end

  private 
  def scoped_by(options=nil, &block)
    if options && scope = options.call
      with_scope(:find => scope) do
        block.call
      end
    else
      block.call
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
by_star-1.0.1 lib/by_star/shared.rb