Permalink
Browse files

Merge pull request #156 from johndouthat/master

Fixes issues with Ruby 1.8.7, etc...
  • Loading branch information...
Mark Coates
Mark Coates committed Apr 24, 2012
2 parents 55877b1 + 3b672b7 commit ddfc1120f426e1378aa8734d5f76c86e725c1037
View
@@ -0,0 +1,6 @@
+[9,10,11,12,14].each do |i|
+ appraise "ar2.3.#{i}" do
+ gem 'activerecord', "2.3.#{i}"
+ end
+end
+
View
@@ -1,10 +1,3 @@
source :rubygems
-gem 'activerecord', '~> 2.3.12'
-
-group :test do
- gem 'jeweler'
- gem 'ruby-debug19'
- gem 'rspec', '1.3.1'
- gem 'sqlite3'
-end
+gemspec
View
@@ -1,38 +1,27 @@
+PATH
+ remote: .
+ specs:
+ searchlogic (2.5.8)
+ activerecord (~> 2.3.8)
+
GEM
remote: http://rubygems.org/
specs:
- activerecord (2.3.12)
- activesupport (= 2.3.12)
- activesupport (2.3.12)
- archive-tar-minitar (0.5.2)
- columnize (0.3.4)
- git (1.2.5)
- jeweler (1.6.4)
- bundler (~> 1.0)
- git (>= 1.2.5)
+ activerecord (2.3.14)
+ activesupport (= 2.3.14)
+ activesupport (2.3.14)
+ appraisal (0.4.1)
+ bundler
rake
- linecache19 (0.5.12)
- ruby_core_source (>= 0.1.4)
- rake (0.9.2)
- rspec (1.3.1)
- ruby-debug-base19 (0.11.25)
- columnize (>= 0.3.1)
- linecache19 (>= 0.5.11)
- ruby_core_source (>= 0.1.4)
- ruby-debug19 (0.11.6)
- columnize (>= 0.3.1)
- linecache19 (>= 0.5.11)
- ruby-debug-base19 (>= 0.11.19)
- ruby_core_source (0.1.5)
- archive-tar-minitar (>= 0.5.2)
- sqlite3 (1.3.4)
+ rake (0.9.2.2)
+ rspec (1.3.2)
+ sqlite3 (1.3.5)
PLATFORMS
ruby
DEPENDENCIES
- activerecord (~> 2.3.12)
- jeweler
- rspec (= 1.3.1)
- ruby-debug19
+ appraisal (= 0.4.1)
+ rspec (~> 1.3.1)
+ searchlogic!
sqlite3
View
@@ -2,6 +2,8 @@
Searchlogic makes using ActiveRecord named scopes easier and less repetitive. It helps keep your code DRY, clean, and simple.
+The specs pass with ActiveRecord 2.3.9 - 2.3.14 on Ruby 1.9.3-p125, 1.9.2-p318, and 1.8.7-p358
+
== Helpful links
* <b>Documentation:</b> http://rdoc.info/projects/binarylogic/searchlogic
View
@@ -1,24 +1,7 @@
-require 'rubygems'
-require 'rake'
-require 'bundler'
-
+#!/usr/bin/env rake
+require "bundler/gem_tasks"
Bundler.setup
-
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "searchlogic"
- gem.summary = "Searchlogic makes using ActiveRecord named scopes easier and less repetitive."
- gem.description = "Searchlogic makes using ActiveRecord named scopes easier and less repetitive."
- gem.email = "bjohnson@binarylogic.com"
- gem.homepage = "http://github.com/binarylogic/searchlogic"
- gem.authors = ["Ben Johnson of Binary Logic"]
- gem.add_bundler_dependencies
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
-end
+require 'appraisal'
require 'spec/rake/spectask'
Spec::Rake::SpecTask.new(:spec) do |spec|
@@ -0,0 +1,7 @@
+# This file was generated by Appraisal
+
+source :rubygems
+
+gem "activerecord", "2.3.10"
+
+gemspec :path=>"../"
@@ -0,0 +1,28 @@
+PATH
+ remote: /Users/john/code/searchlogic
+ specs:
+ searchlogic (2.5.8)
+ activerecord (~> 2.3.8)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ activerecord (2.3.10)
+ activesupport (= 2.3.10)
+ activesupport (2.3.10)
+ appraisal (0.4.1)
+ bundler
+ rake
+ rake (0.9.2.2)
+ rspec (1.3.2)
+ sqlite3 (1.3.5)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ activerecord (= 2.3.10)
+ appraisal (= 0.4.1)
+ rspec (~> 1.3.1)
+ searchlogic!
+ sqlite3
@@ -0,0 +1,7 @@
+# This file was generated by Appraisal
+
+source :rubygems
+
+gem "activerecord", "2.3.11"
+
+gemspec :path=>"../"
@@ -0,0 +1,28 @@
+PATH
+ remote: /Users/john/code/searchlogic
+ specs:
+ searchlogic (2.5.8)
+ activerecord (~> 2.3.8)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ activerecord (2.3.11)
+ activesupport (= 2.3.11)
+ activesupport (2.3.11)
+ appraisal (0.4.1)
+ bundler
+ rake
+ rake (0.9.2.2)
+ rspec (1.3.2)
+ sqlite3 (1.3.5)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ activerecord (= 2.3.11)
+ appraisal (= 0.4.1)
+ rspec (~> 1.3.1)
+ searchlogic!
+ sqlite3
@@ -0,0 +1,7 @@
+# This file was generated by Appraisal
+
+source :rubygems
+
+gem "activerecord", "2.3.12"
+
+gemspec :path=>"../"
@@ -0,0 +1,28 @@
+PATH
+ remote: /Users/john/code/searchlogic
+ specs:
+ searchlogic (2.5.8)
+ activerecord (~> 2.3.8)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ activerecord (2.3.12)
+ activesupport (= 2.3.12)
+ activesupport (2.3.12)
+ appraisal (0.4.1)
+ bundler
+ rake
+ rake (0.9.2.2)
+ rspec (1.3.2)
+ sqlite3 (1.3.5)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ activerecord (= 2.3.12)
+ appraisal (= 0.4.1)
+ rspec (~> 1.3.1)
+ searchlogic!
+ sqlite3
@@ -0,0 +1,7 @@
+# This file was generated by Appraisal
+
+source :rubygems
+
+gem "activerecord", "2.3.14"
+
+gemspec :path=>"../"
@@ -0,0 +1,28 @@
+PATH
+ remote: /Users/john/code/searchlogic
+ specs:
+ searchlogic (2.5.8)
+ activerecord (~> 2.3.8)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ activerecord (2.3.14)
+ activesupport (= 2.3.14)
+ activesupport (2.3.14)
+ appraisal (0.4.1)
+ bundler
+ rake
+ rake (0.9.2.2)
+ rspec (1.3.2)
+ sqlite3 (1.3.5)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ activerecord (= 2.3.14)
+ appraisal (= 0.4.1)
+ rspec (~> 1.3.1)
+ searchlogic!
+ sqlite3
View
@@ -0,0 +1,7 @@
+# This file was generated by Appraisal
+
+source :rubygems
+
+gem "activerecord", "2.3.9"
+
+gemspec :path=>"../"
@@ -0,0 +1,28 @@
+PATH
+ remote: /Users/john/code/searchlogic
+ specs:
+ searchlogic (2.5.8)
+ activerecord (~> 2.3.8)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ activerecord (2.3.9)
+ activesupport (= 2.3.9)
+ activesupport (2.3.9)
+ appraisal (0.4.1)
+ bundler
+ rake
+ rake (0.9.2.2)
+ rspec (1.3.2)
+ sqlite3 (1.3.5)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ activerecord (= 2.3.9)
+ appraisal (= 0.4.1)
+ rspec (~> 1.3.1)
+ searchlogic!
+ sqlite3
View
@@ -1,3 +1,5 @@
+require 'active_record'
+require "searchlogic/version"
require "searchlogic/core_ext/proc"
require "searchlogic/core_ext/object"
require "searchlogic/active_record/consistency"
@@ -8,14 +8,21 @@ module ActiveRecord
module Scope
def scopes
read_inheritable_attribute(:scopes) || write_inheritable_attribute(:scopes, {}.tap do |h|
+
+ class << h
+ attr_accessor :active_record_class
+ end
+ h.active_record_class = self
+
h.instance_eval <<-eval
def include?(key)
result = super
return result if result
- #{name}.respond_to?(key)
+ active_record_class.respond_to?(key)
super
end
eval
+
end)
end
end
@@ -8,7 +8,7 @@ module AliasScope
# or represents a named scope procedure. Ex:
#
# class User
- # def teenager
+ # def self.teenager
# age_gte(13).age_lte(19)
# end
# end
@@ -37,7 +37,7 @@ def alias_scope(name, options = nil)
define_method name do |*args|
case options
when Symbol
- send(options)
+ send(options, *args)
else
options.call(*args)
end
@@ -7,7 +7,7 @@ def conditions
end
def compact_conditions
- conditions.select { |k,v| !v.blank? }
+ Hash[conditions.select { |k,v| !v.blank? }]
end
# Accepts a hash of conditions.
@@ -0,0 +1,3 @@
+module Searchlogic
+ VERSION = "2.5.8"
+end
Oops, something went wrong.

0 comments on commit ddfc112

Please sign in to comment.