sequel_core 1.0.8.1 → 1.0.8.2
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/Rakefile +1 -1
- data/spec/adapters/mysql_spec.rb +0 -1
- data/spec/sequelizer_spec.rb +32 -0
- metadata +2 -2
data/Rakefile
CHANGED
@@ -9,7 +9,7 @@ include FileUtils
|
|
9
9
|
# Configuration
|
10
10
|
##############################################################################
|
11
11
|
NAME = "sequel_core"
|
12
|
-
VERS = "1.0.8.
|
12
|
+
VERS = "1.0.8.2"
|
13
13
|
CLEAN.include ["**/.*.sw?", "pkg/*", ".config", "doc/*", "coverage/*"]
|
14
14
|
RDOC_OPTS = [
|
15
15
|
"--quiet",
|
data/spec/adapters/mysql_spec.rb
CHANGED
data/spec/sequelizer_spec.rb
CHANGED
@@ -507,6 +507,38 @@ context "Proc#to_sql" do
|
|
507
507
|
@criteria = nil
|
508
508
|
proc {if @criteria; :x.like @criteria; else; :x.like 'ddd'; end}.sql.should == "(x LIKE 'ddd')"
|
509
509
|
end
|
510
|
+
|
511
|
+
specify "should support more complex conditional filters" do
|
512
|
+
x, y = true, false
|
513
|
+
proc {
|
514
|
+
if x || y
|
515
|
+
:a.like 'a'
|
516
|
+
else
|
517
|
+
:b.like 'b'
|
518
|
+
end
|
519
|
+
}.sql.should == "(a LIKE 'a')"
|
520
|
+
|
521
|
+
proc {
|
522
|
+
if y
|
523
|
+
:a.like 'a'
|
524
|
+
elsif x
|
525
|
+
:b.like 'b'
|
526
|
+
else
|
527
|
+
:c.like 'c'
|
528
|
+
end
|
529
|
+
}.sql.should == "(b LIKE 'b')"
|
530
|
+
|
531
|
+
@title = 'blah'
|
532
|
+
use_title = true
|
533
|
+
|
534
|
+
proc {
|
535
|
+
if !@title.blank? && use_title
|
536
|
+
:title.like "%#{@title}%"
|
537
|
+
end
|
538
|
+
}.sql.should == "(title LIKE '%blah%')"
|
539
|
+
|
540
|
+
|
541
|
+
end
|
510
542
|
end
|
511
543
|
|
512
544
|
context "Proc#to_sql stock" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequel_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.8.
|
4
|
+
version: 1.0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sharon Rosner
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-02-
|
12
|
+
date: 2008-02-09 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|