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 CHANGED
@@ -1,7 +1,7 @@
1
1
  language: ruby
2
2
  cache: bundler
3
3
  rvm:
4
- - "1.9.3"
5
- - rbx-19mode
4
+ - 1.9.3
5
+ - rbx-2.1.1
6
6
  # uncomment this line if your project needs to run something other than `rake`:
7
7
  # # script: bundle exec rspec spec
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
 
@@ -16,4 +16,5 @@ Gem::Specification.new do |gem|
16
16
  gem.require_paths = ["lib"]
17
17
 
18
18
  gem.add_dependency "activerecord", ">= 4.0.0"
19
+ gem.add_dependency "arel", ">= 4.0.2"
19
20
  end
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module Like
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
data/test/helper.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'bundler/setup'
2
- require 'minitest/spec'
3
2
  require 'minitest/autorun'
3
+ require 'minitest/spec'
4
4
  require 'active_record/like'
5
5
 
6
6
  ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
@@ -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.2
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: 2013-11-21 00:00:00.000000000 Z
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.24
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: