wordjelly-auth 1.3.2 → 1.3.3
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a5d379162e1e991dd1d422f6694bd65749e2bb9
|
4
|
+
data.tar.gz: 5eb0df9157e2ab3181f0f0f65f6a4c603e02c15c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dcf9226d9aa75f5f10ac1614943b62b0a5a601a5336d1d8411821bbc30bad2ea81ebbac9f6dccaec7ad01f915414579c0f9d521bfa19dd13319ff47717828b9
|
7
|
+
data.tar.gz: b574858f0278403feabcf091614347f50d345668a66b7b9ac668e0470d7755ef94a829e5899a7197b3839b5165118521c5980a910f8e37bbfbd5b558fafb030a
|
data/lib/auth/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wordjelly-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bhargav
|
@@ -795,7 +795,6 @@ files:
|
|
795
795
|
- app/models/auth/concerns/notification_concern.rb
|
796
796
|
- app/models/auth/concerns/notification_response_concern.rb
|
797
797
|
- app/models/auth/concerns/owner_concern.rb
|
798
|
-
- app/models/auth/concerns/search/autocompleted_concern.rb
|
799
798
|
- app/models/auth/concerns/shopping/bar_code_concern.rb
|
800
799
|
- app/models/auth/concerns/shopping/cart_concern.rb
|
801
800
|
- app/models/auth/concerns/shopping/cart_item_concern.rb
|
@@ -1,139 +0,0 @@
|
|
1
|
-
module Auth::Concerns::Search::AutocompletedConcern
|
2
|
-
|
3
|
-
extend ActiveSupport::Concern
|
4
|
-
|
5
|
-
unless Auth::Concerns::Search::AutocompleteConcern.included_modules.include? Mongoid::Document
|
6
|
-
include Mongoid::Document
|
7
|
-
end
|
8
|
-
|
9
|
-
unless Auth::Concerns::Search::AutocompleteConcern.included_modules.include? Mongoid::Elasticsearch
|
10
|
-
include Mongoid::Elasticsearch
|
11
|
-
end
|
12
|
-
|
13
|
-
included do
|
14
|
-
|
15
|
-
## the page to which the user will be taken if they click on the suggestion.
|
16
|
-
## REQUIRED
|
17
|
-
field :primary_link, type: String
|
18
|
-
|
19
|
-
## key -> display name
|
20
|
-
## value -> hash
|
21
|
-
## value_key -> :url -> the url
|
22
|
-
## value_key -> :data -> hash of optional data-attributes.
|
23
|
-
field :secondary_links, type: Hash, default: {}
|
24
|
-
|
25
|
-
|
26
|
-
## now let us configure that bitch to show this bitch.
|
27
|
-
## REQUIRED
|
28
|
-
## array of tags on which to do the autocomplete
|
29
|
-
field :tags, type: Array, default: []
|
30
|
-
|
31
|
-
|
32
|
-
## the tags that are shown in case the owner of the resource is not viewing the resource
|
33
|
-
field :masked_tags, type: Array, default: []
|
34
|
-
|
35
|
-
## OPTIONAL
|
36
|
-
## an optional description that will be shown below the result in the autocomplete.
|
37
|
-
field :autocomplete_description, type: String
|
38
|
-
|
39
|
-
AUTOCOMPLETE_INDEX_SETTINGS =
|
40
|
-
{
|
41
|
-
analysis: {
|
42
|
-
filter: {
|
43
|
-
nGram_filter: {
|
44
|
-
type: "nGram",
|
45
|
-
min_gram: 2,
|
46
|
-
max_gram: 20,
|
47
|
-
token_chars: [
|
48
|
-
"letter",
|
49
|
-
"digit",
|
50
|
-
"punctuation",
|
51
|
-
"symbol"
|
52
|
-
]
|
53
|
-
}
|
54
|
-
},
|
55
|
-
analyzer: {
|
56
|
-
nGram_analyzer: {
|
57
|
-
type: "custom",
|
58
|
-
tokenizer: "whitespace",
|
59
|
-
filter: [
|
60
|
-
"lowercase",
|
61
|
-
"asciifolding",
|
62
|
-
"nGram_filter"
|
63
|
-
]
|
64
|
-
},
|
65
|
-
whitespace_analyzer: {
|
66
|
-
type: "custom",
|
67
|
-
tokenizer: "whitespace",
|
68
|
-
filter: [
|
69
|
-
"lowercase",
|
70
|
-
"asciifolding"
|
71
|
-
]
|
72
|
-
}
|
73
|
-
}
|
74
|
-
}
|
75
|
-
}
|
76
|
-
|
77
|
-
AUTOCOMPLETE_INDEX_MAPPINGS =
|
78
|
-
{
|
79
|
-
properties: {
|
80
|
-
tags: {
|
81
|
-
type: "text",
|
82
|
-
analyzer: "nGram_analyzer",
|
83
|
-
search_analyzer: "whitespace_analyzer"
|
84
|
-
},
|
85
|
-
public: {
|
86
|
-
type: "keyword"
|
87
|
-
},
|
88
|
-
resource_id: {
|
89
|
-
type: "keyword"
|
90
|
-
}
|
91
|
-
}
|
92
|
-
}
|
93
|
-
|
94
|
-
before_save do |document|
|
95
|
-
document.set_primary_link
|
96
|
-
document.set_secondary_links
|
97
|
-
document.set_autocomplete_description
|
98
|
-
document.set_autocomplete_tags
|
99
|
-
end
|
100
|
-
|
101
|
-
end
|
102
|
-
|
103
|
-
def set_autocomplete_tags
|
104
|
-
|
105
|
-
end
|
106
|
-
|
107
|
-
def set_primary_link
|
108
|
-
|
109
|
-
end
|
110
|
-
|
111
|
-
def set_secondary_links
|
112
|
-
|
113
|
-
end
|
114
|
-
|
115
|
-
def set_autocomplete_description
|
116
|
-
|
117
|
-
end
|
118
|
-
|
119
|
-
def created_at=(created_at)
|
120
|
-
|
121
|
-
super(created_at)
|
122
|
-
|
123
|
-
return unless self.created_at
|
124
|
-
|
125
|
-
human_readable = self.created_at.strftime("%B %-d %Y")
|
126
|
-
self.tags << human_readable unless self.tags.include? human_readable
|
127
|
-
end
|
128
|
-
|
129
|
-
def clear_autocomplete_data
|
130
|
-
self.primary_link = nil
|
131
|
-
self.secondary_links.clear
|
132
|
-
self.autocomplete_description = nil
|
133
|
-
self.tags.clear
|
134
|
-
end
|
135
|
-
|
136
|
-
## we don't want to index the primary or secondary links
|
137
|
-
## only the tags are considered
|
138
|
-
|
139
|
-
end
|