tag_columns 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/README.md +1 -1
- data/lib/tag_columns.rb +4 -4
- data/lib/tag_columns/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24f11ec231a99f562784740d0fac6e7cff7c5d83
|
4
|
+
data.tar.gz: 07711c4b518ebc23d2204745a10612f4b2ffa7a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31d75863702077cfd2d87cd1ebd96feaab89beafbc3057b527196c8f3c1a2f106de80deb9c0a79581ad28df849a0bf3d2054f0a10178c466a877949718264449
|
7
|
+
data.tar.gz: 4bc98eab66d115fb8caf0f91c9a892d1c539f28e7f0c9a7b22763d2948b3bd01940bd1c4cdfff76a7f43f08cfc1ddd6156ba353cacc44001a76457089f2b04d4
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tag_columns (0.1.
|
4
|
+
tag_columns (0.1.5)
|
5
5
|
activesupport
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activesupport (5.1.
|
10
|
+
activesupport (5.1.4)
|
11
11
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
12
|
i18n (~> 0.7)
|
13
13
|
minitest (~> 5.1)
|
@@ -89,4 +89,4 @@ DEPENDENCIES
|
|
89
89
|
tag_columns!
|
90
90
|
|
91
91
|
BUNDLED WITH
|
92
|
-
1.
|
92
|
+
1.15.4
|
data/README.md
CHANGED
@@ -33,7 +33,7 @@ gem "tag_columns"
|
|
33
33
|
# db/migrate/TIMESTAMP_add_groups_to_user.rb
|
34
34
|
class AddGroupsToUser < ActiveRecord::Migration[5.0]
|
35
35
|
def change
|
36
|
-
add_column :users, :groups, :string, array: true, default:
|
36
|
+
add_column :users, :groups, :string, array: true, default: [], null: false
|
37
37
|
add_index :users, :groups, using: "gin"
|
38
38
|
end
|
39
39
|
end
|
data/lib/tag_columns.rb
CHANGED
@@ -35,10 +35,10 @@ module TagColumns
|
|
35
35
|
result.values.flatten
|
36
36
|
end
|
37
37
|
|
38
|
-
scope :"with_any_#{method_name}", ->(*tags) { where "#{quoted_column_name} && ARRAY[?]::
|
39
|
-
scope :"with_all_#{method_name}", ->(*tags) { where "#{quoted_column_name} @> ARRAY[?]::
|
40
|
-
scope :"without_any_#{method_name}", ->(*tags) { where.not "#{quoted_column_name} && ARRAY[?]::
|
41
|
-
scope :"without_all_#{method_name}", ->(*tags) { where.not "#{quoted_column_name} @> ARRAY[?]::
|
38
|
+
scope :"with_any_#{method_name}", ->(*tags) { where "#{quoted_column_name}::text[] && ARRAY[?]::text[]", tag_columns_sanitize_list(tags) }
|
39
|
+
scope :"with_all_#{method_name}", ->(*tags) { where "#{quoted_column_name}::text[] @> ARRAY[?]::text[]", tag_columns_sanitize_list(tags) }
|
40
|
+
scope :"without_any_#{method_name}", ->(*tags) { where.not "#{quoted_column_name}::text[] && ARRAY[?]::text[]", tag_columns_sanitize_list(tags) }
|
41
|
+
scope :"without_all_#{method_name}", ->(*tags) { where.not "#{quoted_column_name}::text[] @> ARRAY[?]::text[]", tag_columns_sanitize_list(tags) }
|
42
42
|
|
43
43
|
before_validation Proc.new { self[column_name] = self.class.tag_columns_sanitize_list(self[column_name]) }
|
44
44
|
|
data/lib/tag_columns/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tag_columns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Hopkins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
117
|
version: '0'
|
118
118
|
requirements: []
|
119
119
|
rubyforge_project:
|
120
|
-
rubygems_version: 2.6.
|
120
|
+
rubygems_version: 2.6.13
|
121
121
|
signing_key:
|
122
122
|
specification_version: 4
|
123
123
|
summary: Fast & simple Rails ActiveRecord model tagging using PostgreSQL's Array datatype
|