Permalink
Browse files

fix conflicts

  • Loading branch information...
2 parents e9fcb6f + a4b6e99 commit 995caa443e445f109960b1c0dc1608c0a6369dd0 @binarylogic committed Mar 1, 2011
Showing with 27 additions and 5 deletions.
  1. +10 −0 Gemfile
  2. +4 −3 Rakefile
  3. +13 −2 spec/searchlogic/named_scopes/association_conditions_spec.rb
View
10 Gemfile
@@ -0,0 +1,10 @@
+source :rubygems
+
+gem 'jeweler'
+
+gem 'activerecord', '>= 2.0.0'
+
+group :test do
+ gem 'rspec', '1.3.1'
+ gem 'sqlite3-ruby'
+end
View
@@ -1,5 +1,8 @@
require 'rubygems'
require 'rake'
+require 'bundler'
+
+Bundler.setup
begin
require 'jeweler'
@@ -10,7 +13,7 @@ begin
gem.email = "bjohnson@binarylogic.com"
gem.homepage = "http://github.com/binarylogic/searchlogic"
gem.authors = ["Ben Johnson of Binary Logic"]
- gem.add_dependency "activerecord", ">= 2.0.0"
+ gem.add_bundler_dependencies
end
Jeweler::GemcutterTasks.new
rescue LoadError
@@ -29,6 +32,4 @@ Spec::Rake::SpecTask.new(:rcov) do |spec|
spec.rcov = true
end
-task :spec => :check_dependencies
-
task :default => :spec
@@ -158,7 +158,7 @@
User.named_scope(:orders_big_id, :joins => User.inner_joins(:orders))
Company.users_orders_big_id.proxy_options.should == {:joins=>[" INNER JOIN \"users\" ON users.company_id = companies.id ", " INNER JOIN \"orders\" ON orders.user_id = users.id "]}
end
-
+
it "should order the join statements ascending by the fieldnames so that we don't get double joins where the only difference is that the order of the fields is different" do
company = Company.create
user = company.users.create(:company_id => company.id)
@@ -200,4 +200,15 @@
Company.users_id_equals_any([user2.id, user3.id]).all(:select => "DISTINCT companies.*").should == [company2]
end
-end
+
+ it "should allow dynamic scope generation on associations without losing association scope options" do
+ pending
+ user = User.create
+ Order.create :user => user, :shipped_on => Time.now
+ Order.create :shipped_on => Time.now
+ # The next line causes the assertion to fail
+ Order.named_scope :shipped_on_not_null, :conditions => ['shipped_on is not null']
+ user.orders.shipped_on_not_null.shipped_on_greater_than(2.days.ago).count.should == 1
+ end
+
+end

0 comments on commit 995caa4

Please sign in to comment.