Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes arity problem introduced by rails 3.2.5. Fixes #1

* Also master is now 3.2 only.
  • Loading branch information...
commit 387a131cf3eb9d46de1b4f184b29e2cfd9805be2 1 parent 866459e
@metaskills authored
View
3  .travis.yml
@@ -3,6 +3,3 @@ rvm:
- 1.9.2
- 1.9.3
- ree
-gemfile:
-- Gemfile.rails-3.1
-- Gemfile.rails-3.2
View
5 CHANGELOG
@@ -1,6 +1,11 @@
= master
+= 3.2.0
+
+* ActiveRecord 3.2 only.
+
+
= 3.1.0
* Works with ActiveRecord 3.1 or 3.2
View
3  Gemfile
@@ -1 +1,2 @@
-eval File.read('Gemfile.rails-3.1')
+source :rubygems
+gemspec
View
9 Gemfile.rails-3.1
@@ -1,9 +0,0 @@
-source :rubygems
-
-spec = eval File.read('grouped_scope.gemspec')
-deps = spec.dependencies.map { |dep| {:name => dep.name, :version => dep.requirement.to_s} }
-
-deps.reject! { |dep| dep[:name] =~ /activerecord/ }
-deps.each { |dep| gem dep[:name], dep[:version] }
-
-gem 'activerecord', '~> 3.1.3'
View
9 Gemfile.rails-3.2
@@ -1,9 +0,0 @@
-source :rubygems
-
-spec = eval File.read('grouped_scope.gemspec')
-deps = spec.dependencies.map { |dep| {:name => dep.name, :version => dep.requirement.to_s} }
-
-deps.reject! { |dep| dep[:name] =~ /activerecord/ }
-deps.each { |dep| gem dep[:name], dep[:version] }
-
-gem 'activerecord', '3.2.0.rc1'
View
4 README.md
@@ -8,10 +8,10 @@ GroupedScope provides an easy way to group objects and to allow those groups to
## Installation
-Install the gem with bundler. We follow a semantic versioning format that tracks ActiveRecord's minor version. So this means to use the latest 3.1.x version of GroupedScope with any ActiveRecord 3.1 version.
+Install the gem with bundler. We follow a semantic versioning format that tracks ActiveRecord's minor version. So this means to use the latest 3.2.x version of GroupedScope with any ActiveRecord 3.2 version.
```ruby
-gem 'grouped_scope', '~> 3.1.0'
+gem 'grouped_scope', '~> 3.2.0'
```
View
2  grouped_scope.gemspec
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ['lib']
s.rdoc_options = ['--charset=UTF-8']
- s.add_runtime_dependency 'activerecord', '~> 3.1'
+ s.add_runtime_dependency 'activerecord', '~> 3.2.0'
s.add_development_dependency 'sqlite3', '~> 1.3'
s.add_development_dependency 'rake', '~> 0.9.2'
s.add_development_dependency 'minitest', '~> 2.8.1'
View
1  lib/grouped_scope.rb
@@ -1,5 +1,6 @@
require 'active_record'
require 'active_record/version'
+require 'active_support/all'
require 'grouped_scope/errors'
require 'grouped_scope/self_grouping'
View
5 lib/grouped_scope/arish/relation/predicate_builer.rb
@@ -9,13 +9,12 @@ module PredicateBuilder
end
module ClassMethods
-
- def build_from_hash_with_grouped_scope(engine, attributes, default_table)
+ def build_from_hash_with_grouped_scope(engine, attributes, default_table, check_column = true)
attributes.select{ |column, value| GroupedScope::SelfGroupping === value }.each do |column_value|
column, value = column_value
attributes[column] = value.arel_table[column.to_s].in(value.ids_sql)
end
- build_from_hash_without_grouped_scope(engine, attributes, default_table)
+ build_from_hash_without_grouped_scope(engine, attributes, default_table, check_column)
end
end
View
2  lib/grouped_scope/version.rb
@@ -1,3 +1,3 @@
module GroupedScope
- VERSION = '3.1.2'
+ VERSION = '3.2.0'
end
View
5 test/helper.rb
@@ -1,7 +1,6 @@
require 'rubygems'
-require 'bundler'
-require "bundler/setup"
-Bundler.require
+require 'bundler/setup'
+Bundler.require :default, :development
require 'grouped_scope'
require 'minitest/autorun'
require 'factories'
Please sign in to comment.
Something went wrong with that request. Please try again.