squeel 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/lib/squeel/adapters/active_record/3.0/relation_extensions.rb +1 -1
- data/lib/squeel/adapters/active_record/3.1/relation_extensions.rb +1 -1
- data/lib/squeel/version.rb +1 -1
- data/spec/squeel/adapters/active_record/relation_extensions_spec.rb +5 -0
- data/spec/support/schema.rb +2 -0
- metadata +4 -4
data/CHANGELOG.md
CHANGED
@@ -40,7 +40,7 @@ module Squeel
|
|
40
40
|
# the relations we're merging, and then use the default AR merge
|
41
41
|
# code on the result.
|
42
42
|
def merge(r, relations_visited = false)
|
43
|
-
if relations_visited
|
43
|
+
if relations_visited or not ::ActiveRecord::Relation === r
|
44
44
|
super(r)
|
45
45
|
else
|
46
46
|
clone.visit!.merge(r.clone.visit!, true)
|
@@ -40,7 +40,7 @@ module Squeel
|
|
40
40
|
# the relations we're merging, and then use the default AR merge
|
41
41
|
# code on the result.
|
42
42
|
def merge(r, relations_visited = false)
|
43
|
-
if relations_visited
|
43
|
+
if relations_visited or not ::ActiveRecord::Relation === r
|
44
44
|
super(r)
|
45
45
|
else
|
46
46
|
clone.visit!.merge(r.clone.visit!, true)
|
data/lib/squeel/version.rb
CHANGED
data/spec/support/schema.rb
CHANGED
@@ -21,6 +21,8 @@ class Person < ActiveRecord::Base
|
|
21
21
|
has_many :outgoing_messages, :class_name => 'Message', :foreign_key => :author_id
|
22
22
|
has_many :incoming_messages, :class_name => 'Message', :foreign_key => :recipient_id
|
23
23
|
|
24
|
+
scope :nil_scope, lambda { nil }
|
25
|
+
|
24
26
|
sifter :name_starts_or_ends_with do |value|
|
25
27
|
(name =~ "#{value}%") | (name =~ "%#{value}")
|
26
28
|
end
|
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
|
+
version: 1.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -240,7 +240,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
240
240
|
version: '0'
|
241
241
|
segments:
|
242
242
|
- 0
|
243
|
-
hash:
|
243
|
+
hash: 4164570062879011051
|
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:
|
252
|
+
hash: 4164570062879011051
|
253
253
|
requirements: []
|
254
254
|
rubyforge_project: squeel
|
255
255
|
rubygems_version: 1.8.24
|