simple_taggable 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 10c09aad53d3b7bff5a795fad6baaacc97064b31
4
- data.tar.gz: 8cce20273f943605e08d70fac5330d57147dddd8
3
+ metadata.gz: 3d0262bfe132b7511991593c2a22e104d5742528
4
+ data.tar.gz: 2e89ce1e7fc1841bc38f5ba53801763560f9f5d4
5
5
  SHA512:
6
- metadata.gz: 49519a37d7ab1a3d209c14d69b34e7fa0de120d8c1cade701f88570e3008967e2cc4687404d5b6f123a84be14b26f28b6f5426beddc3ad12391cb76f678feac4
7
- data.tar.gz: a9a9ab96725bd43deda79278d3d5d8fd0e771639d7af5bfea0c8af859dd73f23dc77cce6b535a08b0ddc3d4e3b7d1e95ce4ae11c5f1667057f4b76350d68830f
6
+ metadata.gz: e83bf560d7534478b89e78ad1b5802ac3a7119f200c51923f3195eb6bd8d2555a4a4c7b541c980b934fbde123b92f20949bc09eaed57f41eb534c03101f23f53
7
+ data.tar.gz: 2a8c3c76a25b8f52119a41adfcf01c5da956f4ad0a1f4b904e29f63dcdb5cd417fdbe06954f4e182f1bd5d4a1801016e1b983f60d52a6b9e12a3ca47568d54b1
data/.travis.yml CHANGED
@@ -7,7 +7,14 @@ rvm:
7
7
  - 2.2
8
8
  - 2.1
9
9
 
10
+ env:
11
+ - DB=postgres
12
+ - DB=mysql
13
+ - DB=sqlite3
14
+
10
15
  before_script:
16
+ - mysql -e 'create database simple_taggable;'
17
+ - psql -c 'create database simple_taggable;' -U postgres
11
18
  - bundle exec rake test:copy_migrations
12
19
 
13
20
  gemfile:
@@ -21,11 +21,11 @@ module SimpleTaggable
21
21
  tag_scope = SimpleTaggable::Models::Tag.where(name: tag_name)
22
22
 
23
23
  if exclude
24
- users = User.joins(:tags).merge(tag_scope).group(%W("#{table_name}"."id"))
25
- where.not(id: users.pluck(:id))
24
+ records = joins(:tags).merge(tag_scope).group(%W(#{quoted_table_name}.#{connection.quote_column_name("id")}))
25
+ where.not(id: records.pluck(:id))
26
26
  else
27
- User.joins(:tags).merge(tag_scope).group(%W("#{table_name}"."id")).tap do |scope|
28
- break scope.having("count(*) == ?", tag_name.length) if match_all
27
+ joins(:tags).merge(tag_scope).group(%W(#{quoted_table_name}.#{connection.quote_column_name("id")})).tap do |scope|
28
+ break scope.having("count(*) = ?", tag_name.length) if match_all
29
29
  end
30
30
  end
31
31
  }
@@ -1,3 +1,3 @@
1
1
  module SimpleTaggable
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -27,6 +27,8 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency "rspec", "~> 3.0"
28
28
  spec.add_development_dependency "database_cleaner"
29
29
  spec.add_development_dependency "sqlite3"
30
+ spec.add_development_dependency "pg"
31
+ spec.add_development_dependency "mysql2", "~> 0.3.0"
30
32
  spec.add_development_dependency "shoulda-matchers"
31
33
  spec.add_development_dependency "coveralls"
32
34
  end
data/spec/spec_helper.rb CHANGED
@@ -4,10 +4,27 @@ Coveralls.wear!
4
4
 
5
5
  require "active_record"
6
6
 
7
- ActiveRecord::Base.establish_connection(
8
- adapter: "sqlite3",
9
- database: ":memory:"
10
- )
7
+ case ENV["DB"]
8
+ when "postgres"
9
+ require "pg"
10
+ ActiveRecord::Base.establish_connection(
11
+ adapter: "postgresql",
12
+ database: "simple_taggable",
13
+ username: "postgres"
14
+ )
15
+ when "mysql"
16
+ require "mysql2"
17
+ ActiveRecord::Base.establish_connection(
18
+ adapter: "mysql2",
19
+ database: "simple_taggable",
20
+ username: "root"
21
+ )
22
+ else
23
+ ActiveRecord::Base.establish_connection(
24
+ adapter: "sqlite3",
25
+ database: ":memory:"
26
+ )
27
+ end
11
28
 
12
29
  require 'simple_taggable'
13
30
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_taggable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - joker1007
@@ -122,6 +122,34 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: pg
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: mysql2
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 0.3.0
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 0.3.0
125
153
  - !ruby/object:Gem::Dependency
126
154
  name: shoulda-matchers
127
155
  requirement: !ruby/object:Gem::Requirement