Skip to content

Commit

Permalink
Fixes arity problem introduced by rails 3.2.5. Fixes metaskills#1
Browse files Browse the repository at this point in the history
* Also master is now 3.2 only.
  • Loading branch information
metaskills committed Jun 12, 2012
1 parent 866459e commit 387a131
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 32 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@ rvm:
- 1.9.2
- 1.9.3
- ree
gemfile:
- Gemfile.rails-3.1
- Gemfile.rails-3.2
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@

= master

= 3.2.0

* ActiveRecord 3.2 only.


= 3.1.0

* Works with ActiveRecord 3.1 or 3.2
Expand Down
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
eval File.read('Gemfile.rails-3.1')
source :rubygems
gemspec
9 changes: 0 additions & 9 deletions Gemfile.rails-3.1

This file was deleted.

9 changes: 0 additions & 9 deletions Gemfile.rails-3.2

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
```


Expand Down
2 changes: 1 addition & 1 deletion grouped_scope.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 1 addition & 0 deletions lib/grouped_scope.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'active_record'
require 'active_record/version'
require 'active_support/all'
require 'grouped_scope/errors'
require 'grouped_scope/self_grouping'

Expand Down
5 changes: 2 additions & 3 deletions lib/grouped_scope/arish/relation/predicate_builer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/grouped_scope/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module GroupedScope
VERSION = '3.1.2'
VERSION = '3.2.0'
end
5 changes: 2 additions & 3 deletions test/helper.rb
Original file line number Diff line number Diff line change
@@ -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'
Expand Down

0 comments on commit 387a131

Please sign in to comment.