squeel 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 1.0.5 (2012-06-08)
2
+
3
+ * Stop visiting group_values on merge. AR hates ARel attributes in
4
+ group_values.
5
+
1
6
  ## 1.0.4 (2012-06-07)
2
7
 
3
8
  * Fix regression in merge causing issues with scopes returning nil
@@ -53,7 +53,8 @@ module Squeel
53
53
 
54
54
  @where_values = predicate_viz.accept((@where_values - ['']).uniq)
55
55
  @having_values = predicate_viz.accept(@having_values.uniq.reject{|h| h.blank?})
56
- @group_values = attribute_viz.accept(@group_values.uniq.reject{|g| g.blank?})
56
+ # FIXME: AR barfs on ARel attributes in group_values. Workaround?
57
+ # @group_values = attribute_viz.accept(@group_values.uniq.reject{|g| g.blank?})
57
58
  @order_values = attribute_viz.accept(@order_values.uniq.reject{|o| o.blank?})
58
59
  @select_values = attribute_viz.accept(@select_values.uniq)
59
60
 
@@ -63,7 +63,8 @@ module Squeel
63
63
 
64
64
  @where_values = predicate_viz.accept((@where_values - ['']).uniq)
65
65
  @having_values = predicate_viz.accept(@having_values.uniq.reject{|h| h.blank?})
66
- @group_values = attribute_viz.accept(@group_values.uniq.reject{|g| g.blank?})
66
+ # FIXME: AR barfs on ARel attributes in group_values. Workaround?
67
+ # @group_values = attribute_viz.accept(@group_values.uniq.reject{|g| g.blank?})
67
68
  @order_values = attribute_viz.accept(@order_values.uniq.reject{|o| o.blank?})
68
69
  @select_values = attribute_viz.accept(@select_values.uniq)
69
70
 
@@ -1,22 +1 @@
1
- module Arel
2
-
3
- module Nodes
4
-
5
- class Grouping < Unary
6
- include Arel::Predications
7
- end unless Grouping.include?(Arel::Predications)
8
-
9
- end
10
-
11
- module Visitors
12
-
13
- class DepthFirst < Visitor
14
-
15
- unless method_defined?(:visit_Arel_Nodes_InfixOperation)
16
- alias :visit_Arel_Nodes_InfixOperation :binary
17
- end
18
-
19
- end
20
-
21
- end
22
- end
1
+ require 'squeel/adapters/active_record/3.1/compat'
@@ -1,3 +1,3 @@
1
1
  module Squeel
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
@@ -686,6 +686,11 @@ module Squeel
686
686
  relation.should eq Person.scoped
687
687
  end
688
688
 
689
+ it "doesn't ruin everything when a group exists" do
690
+ relation = Person.scoped.merge(Person.group{name})
691
+ count_hash = relation.count
692
+ end
693
+
689
694
  end
690
695
 
691
696
  describe '#to_a' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: squeel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -240,7 +240,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
240
240
  version: '0'
241
241
  segments:
242
242
  - 0
243
- hash: 4164570062879011051
243
+ hash: -4324622899470909075
244
244
  required_rubygems_version: !ruby/object:Gem::Requirement
245
245
  none: false
246
246
  requirements:
@@ -249,7 +249,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
249
249
  version: '0'
250
250
  segments:
251
251
  - 0
252
- hash: 4164570062879011051
252
+ hash: -4324622899470909075
253
253
  requirements: []
254
254
  rubyforge_project: squeel
255
255
  rubygems_version: 1.8.24