redmine_crm 0.0.27 → 0.0.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/CHANGELOG +4 -0
- data/lib/redmine_crm/acts_as_taggable/rcrm_acts_as_taggable.rb +7 -7
- data/lib/redmine_crm/version.rb +1 -1
- 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: 06e250724e907f5c6c3b2590d5bd59994d21bba4
|
4
|
+
data.tar.gz: 43d893aed3e87d16da19667b5a3705cc190d07aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 210d2487c18e8a6d9a540f889fc30b8631922cc9aef5c98856f4cd2ae5e2e6669ec43bc87359d27fd5d5f9463e185c00219308f2ea3a64f358b2faef477e83aa
|
7
|
+
data.tar.gz: 429c087175aba643771e724e8137b57875552b6026c2bcb5bce3f55f7dbab42c4275c26e1f802cc9a3203124b678732d857e94011b17655a5c70d1a7c0a12be3
|
data/doc/CHANGELOG
CHANGED
@@ -90,7 +90,7 @@ module RedmineCrm
|
|
90
90
|
# Example: Question.available_tags(@project_id )
|
91
91
|
def available_tags(project = nil, limit = 30)
|
92
92
|
scope = Tag.where({})
|
93
|
-
class_name =
|
93
|
+
class_name = quote_string_value(base_class.name)
|
94
94
|
join = []
|
95
95
|
join << "JOIN #{Tagging.table_name} ON #{Tagging.table_name}.tag_id = #{Tag.table_name}.id "
|
96
96
|
join << "JOIN #{table_name} ON #{table_name}.id = #{Tagging.table_name}.taggable_id
|
@@ -136,7 +136,7 @@ module RedmineCrm
|
|
136
136
|
AND #{Tagging.table_name}.taggable_id IN (#{related_ids})
|
137
137
|
AND #{Tagging.table_name}.tag_id = #{Tag.table_name}.id").order(
|
138
138
|
options[:order] || "count DESC, #{Tag.table_name}.name").group(
|
139
|
-
"#{Tag.table_name}.id, #{Tag.table_name}.name HAVING #{Tag.table_name}.name NOT IN (#{tags.map { |n|
|
139
|
+
"#{Tag.table_name}.id, #{Tag.table_name}.name HAVING #{Tag.table_name}.name NOT IN (#{tags.map { |n| quote_string_value(n) }.join(",")})")
|
140
140
|
end
|
141
141
|
|
142
142
|
# Pass either a tag, string, or an array of strings or tags.
|
@@ -164,7 +164,7 @@ module RedmineCrm
|
|
164
164
|
taggings_alias, tags_alias = "#{table_name}_taggings", "#{table_name}_tags"
|
165
165
|
|
166
166
|
joins = [
|
167
|
-
"INNER JOIN #{Tagging.table_name} #{taggings_alias} ON #{taggings_alias}.taggable_id = #{table_name}.#{primary_key} AND #{taggings_alias}.taggable_type = #{
|
167
|
+
"INNER JOIN #{Tagging.table_name} #{taggings_alias} ON #{taggings_alias}.taggable_id = #{table_name}.#{primary_key} AND #{taggings_alias}.taggable_type = #{quote_string_value(base_class.name)}",
|
168
168
|
"INNER JOIN #{Tag.table_name} #{tags_alias} ON #{tags_alias}.id = #{taggings_alias}.tag_id"
|
169
169
|
]
|
170
170
|
|
@@ -173,7 +173,7 @@ module RedmineCrm
|
|
173
173
|
#{table_name}.id NOT IN
|
174
174
|
(SELECT #{Tagging.table_name}.taggable_id FROM #{Tagging.table_name}
|
175
175
|
INNER JOIN #{Tag.table_name} ON #{Tagging.table_name}.tag_id = #{Tag.table_name}.id
|
176
|
-
WHERE #{tags_condition(tags)} AND #{Tagging.table_name}.taggable_type = #{
|
176
|
+
WHERE #{tags_condition(tags)} AND #{Tagging.table_name}.taggable_type = #{quote_string_value(base_class.name)})
|
177
177
|
END
|
178
178
|
else
|
179
179
|
if options.delete(:match_all)
|
@@ -198,7 +198,7 @@ module RedmineCrm
|
|
198
198
|
join = <<-END
|
199
199
|
INNER JOIN #{Tagging.table_name} #{taggings_alias} ON
|
200
200
|
#{taggings_alias}.taggable_id = #{table_name}.#{primary_key} AND
|
201
|
-
#{taggings_alias}.taggable_type = #{
|
201
|
+
#{taggings_alias}.taggable_type = #{quote_string_value(base_class.name)}
|
202
202
|
|
203
203
|
INNER JOIN #{Tag.table_name} #{tags_alias} ON
|
204
204
|
#{taggings_alias}.tag_id = #{tags_alias}.id AND
|
@@ -229,7 +229,7 @@ module RedmineCrm
|
|
229
229
|
conditions = []
|
230
230
|
conditions << send(:sanitize_conditions, options.delete(:conditions)) if options[:conditions]
|
231
231
|
conditions << send(:sanitize_conditions, scope) if scope
|
232
|
-
conditions << "#{Tagging.table_name}.taggable_type = #{
|
232
|
+
conditions << "#{Tagging.table_name}.taggable_type = #{quote_string_value(base_class.name)}"
|
233
233
|
conditions << type_condition unless descends_from_active_record?
|
234
234
|
conditions.compact!
|
235
235
|
conditions = conditions.join(" AND ")
|
@@ -249,7 +249,7 @@ module RedmineCrm
|
|
249
249
|
end
|
250
250
|
|
251
251
|
private
|
252
|
-
def
|
252
|
+
def quote_string_value(object)
|
253
253
|
sanitize(object)
|
254
254
|
end
|
255
255
|
|
data/lib/redmine_crm/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redmine_crm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.28
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RedmineUP
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid
|