ecm_tags 0.0.4 → 1.0.0
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.
- checksums.yaml +4 -4
- data/app/controllers/ecm/tags/tag_searchs_controller.rb +1 -1
- data/app/models/ecm/tags/tag_search.rb +13 -7
- data/app/views/ecm/tags/tag_searchs/new.haml +1 -1
- data/config/locales/de.yml +3 -0
- data/lib/ecm/tags/configuration.rb +1 -0
- data/lib/ecm/tags/version.rb +1 -1
- data/lib/generators/ecm/tags/install/templates/initializer.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 48c7c394a3a5e2df86cc629b57e93534e82ab34d
|
|
4
|
+
data.tar.gz: 3bb976c8cc6d988a21caf96e4af0ab1629a40f30
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c4b9abfebe2c615b16944a3c5f7d3a4fb5ed364e0fd007feccccf2f8bc71a74833ef0bfdcc0dafacb68c92244d27bbf5c4338807bbe80b1eb32c63f364377f39
|
|
7
|
+
data.tar.gz: 72304783882c072c0fc5017621c674d209a65f3e5b8114e69edc377809e04808dec313ec1c1c8443db1169c9efc34bcf56f72f51a729f8672a6004c18ba5fd70
|
|
@@ -2,12 +2,18 @@ module Ecm::Tags
|
|
|
2
2
|
class TagSearch
|
|
3
3
|
include ActiveModel::Model
|
|
4
4
|
|
|
5
|
-
attr_accessor :tag_list, :result, :taggable_classes, :
|
|
5
|
+
attr_accessor :tag_list, :result, :taggable_classes, :exact
|
|
6
|
+
|
|
7
|
+
validates :tag_list, presence: true
|
|
6
8
|
|
|
7
9
|
def self.call(*args)
|
|
8
10
|
new(*args).do_work
|
|
9
11
|
end
|
|
10
12
|
|
|
13
|
+
def self.i18n_scope
|
|
14
|
+
:activerecord
|
|
15
|
+
end
|
|
16
|
+
|
|
11
17
|
def do_work
|
|
12
18
|
say "#{self.class.name} running..."
|
|
13
19
|
output = result
|
|
@@ -36,12 +42,12 @@ module Ecm::Tags
|
|
|
36
42
|
@taggable_classes ||= Ecm::Tags::Tagging.uniq.pluck(:taggable_type)
|
|
37
43
|
end
|
|
38
44
|
|
|
39
|
-
def
|
|
40
|
-
@
|
|
45
|
+
def exact
|
|
46
|
+
@exact ||= Ecm::Tags::Configuration.tag_search_exact_default_value
|
|
41
47
|
end
|
|
42
48
|
|
|
43
|
-
def
|
|
44
|
-
@
|
|
49
|
+
def exact=(value)
|
|
50
|
+
@exact = ActiveRecord::Type::Boolean.new.type_cast_from_database(value)
|
|
45
51
|
end
|
|
46
52
|
|
|
47
53
|
private
|
|
@@ -54,11 +60,11 @@ module Ecm::Tags
|
|
|
54
60
|
end
|
|
55
61
|
|
|
56
62
|
def wild
|
|
57
|
-
@wild ||=
|
|
63
|
+
@wild ||= !exact
|
|
58
64
|
end
|
|
59
65
|
|
|
60
66
|
def any
|
|
61
|
-
@any ||=
|
|
67
|
+
@any ||= !exact
|
|
62
68
|
end
|
|
63
69
|
|
|
64
70
|
def search
|
data/config/locales/de.yml
CHANGED
data/lib/ecm/tags/version.rb
CHANGED
|
@@ -10,4 +10,10 @@ Ecm::Tags.configure do |config|
|
|
|
10
10
|
# Default: config.add_submit_button_to_search_box = true
|
|
11
11
|
#
|
|
12
12
|
config.add_submit_button_to_search_box = true
|
|
13
|
+
|
|
14
|
+
# Use exact search by default or not.
|
|
15
|
+
#
|
|
16
|
+
# Default: config.tag_search_exact_default_value = false
|
|
17
|
+
#
|
|
18
|
+
config.tag_search_exact_default_value = false
|
|
13
19
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ecm_tags
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Roberto Vasquez Angel
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-04-
|
|
11
|
+
date: 2016-04-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|