activerecord-like 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +2 -2
- data/README.md +1 -1
- data/activerecord-like.gemspec +1 -0
- data/lib/active_record/like/version.rb +1 -1
- data/test/helper.rb +1 -1
- data/test/integration/like_test.rb +6 -0
- data/test/integration/not_like_test.rb +6 -0
- metadata +19 -9
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# ActiveRecord::Like
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/ReneB/activerecord-like.png)](https://travis-ci.org/ReneB/activerecord-like)
|
3
|
+
[![Build Status](https://travis-ci.org/ReneB/activerecord-like.png?branch=master)](https://travis-ci.org/ReneB/activerecord-like)
|
4
4
|
[![Code Climate](https://codeclimate.com/github/ReneB/activerecord-like.png)](https://codeclimate.com/github/ReneB/activerecord-like)
|
5
5
|
[![Dependency Status](https://gemnasium.com/ReneB/activerecord-like.png)](https://gemnasium.com/ReneB/activerecord-like)
|
6
6
|
|
data/activerecord-like.gemspec
CHANGED
data/test/helper.rb
CHANGED
@@ -24,6 +24,12 @@ describe ActiveRecord::QueryMethods::WhereChain do
|
|
24
24
|
lowercase_posts.map(&:id).must_equal(uppercase_posts.map(&:id))
|
25
25
|
end
|
26
26
|
|
27
|
+
it "is chainable" do
|
28
|
+
Post.where.like(title: '%there?').order(:title).update_all(title: 'some title')
|
29
|
+
|
30
|
+
Post.find(2).title.must_equal('some title')
|
31
|
+
end
|
32
|
+
|
27
33
|
it "does not find records with attributes not matching the criteria" do
|
28
34
|
Post.where.like(title: '%this title is not used anywhere%').map(&:id).wont_include 2
|
29
35
|
end
|
@@ -24,6 +24,12 @@ describe ActiveRecord::QueryMethods::WhereChain do
|
|
24
24
|
lowercase_posts.map(&:id).must_equal(uppercase_posts.map(&:id))
|
25
25
|
end
|
26
26
|
|
27
|
+
it "is chainable" do
|
28
|
+
Post.where.not_like(title: '%there?').order(:title).update_all(title: 'some title')
|
29
|
+
|
30
|
+
Post.find(1).title.must_equal('some title')
|
31
|
+
end
|
32
|
+
|
27
33
|
it "does not find records with attributes matching the criteria" do
|
28
34
|
Post.where.not_like(title: '%this title is not used anywhere%').map(&:id).must_include 2
|
29
35
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-like
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
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:
|
12
|
+
date: 2014-02-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -27,6 +27,22 @@ dependencies:
|
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: 4.0.0
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: arel
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 4.0.2
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 4.0.2
|
30
46
|
description: An ActiveRecord plugin providing a higher-level abstraction for SQL 'LIKE'
|
31
47
|
queries
|
32
48
|
email:
|
@@ -62,21 +78,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
62
78
|
- - ! '>='
|
63
79
|
- !ruby/object:Gem::Version
|
64
80
|
version: '0'
|
65
|
-
segments:
|
66
|
-
- 0
|
67
|
-
hash: -4576696767238257655
|
68
81
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
82
|
none: false
|
70
83
|
requirements:
|
71
84
|
- - ! '>='
|
72
85
|
- !ruby/object:Gem::Version
|
73
86
|
version: '0'
|
74
|
-
segments:
|
75
|
-
- 0
|
76
|
-
hash: -4576696767238257655
|
77
87
|
requirements: []
|
78
88
|
rubyforge_project:
|
79
|
-
rubygems_version: 1.8.
|
89
|
+
rubygems_version: 1.8.23
|
80
90
|
signing_key:
|
81
91
|
specification_version: 3
|
82
92
|
summary: ! 'ActiveRecord::Like provides ActiveRecord::Base with where.like(attribute:
|