Sha256: 5b6fcdac41e1774c134adbbf61c89f9a2cd2a14e682c649ade1b5023693c7e41

Contents?: true

Size: 675 Bytes

Versions: 6

Compression:

Stored size: 675 Bytes

Contents

require 'rubygems'
gem 'sqlite3-ruby'

require 'ruby-debug'

require File.join(File.dirname(__FILE__), '..', 'lib', 'record_filter')

module TestModel
end

require File.join(File.dirname(__FILE__), '..', 'spec', 'models')

ActiveRecord::Base.establish_connection(
  :adapter => 'sqlite3',
  :database => File.join(File.dirname(__FILE__), '..', 'spec', 'test.db')
)

@blog = Class.new(Blog)
@blog.named_filter :somethings do
  having(:ads) do
    with(:content, nil)
  end
  join(Post, :left) do
    on(:id => :blog_id)
    join(Comment, :inner) do
      on(:id => :post_id)
      on(:offensive, true)
    end
  end
  group_by(:id)
end

10000.times do
  @blog.somethings
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
aub-record_filter-0.8.0 test/performance_test.rb
aub-record_filter-0.9.0 test/performance_test.rb
aub-record_filter-0.9.1 test/performance_test.rb
aub-record_filter-0.9.2 test/performance_test.rb
aub-record_filter-0.9.3 test/performance_test.rb
outoftime-record_filter-0.8.0 test/performance_test.rb