redmine_crm 0.0.28 → 0.0.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bitbucket-pipelines.yml +17 -0
- data/doc/CHANGELOG +8 -0
- data/lib/redmine_crm/acts_as_taggable/rcrm_acts_as_taggable.rb +13 -10
- data/lib/redmine_crm/acts_as_votable/votable.rb +3 -6
- data/lib/redmine_crm/version.rb +1 -1
- data/test/acts_as_taggable/rcrm_acts_as_taggable_test.rb +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdec6b77ac05dfc60cd61d029f48518f10991435
|
4
|
+
data.tar.gz: b6df25550e4e7f9bb3c3ebce58d119f3ed08647e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f03058fb24c1d3777387fc3febd8a6fd502c5f7c3e2e754c58a195b39289b45b3a9f767109551f1ff7c831c10abf1686899072310e0ae6b6d145fc3712dfe47
|
7
|
+
data.tar.gz: 3ae7e0950ff7fb8023340030a33c6cc713f2f89f272a580065b4bbd7357dc3503e8389fd89d767496b07f0ea558c382427add867b8ecd22fd2c6cac0f90cdec6
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# This is a sample build configuration for Ruby.
|
2
|
+
# Check our guides at https://confluence.atlassian.com/x/8r-5Mw for more examples.
|
3
|
+
# Only use spaces to indent your .yml configuration.
|
4
|
+
# -----
|
5
|
+
# You can specify a custom docker image from Docker Hub as your build environment.
|
6
|
+
image: ruby:2.3.0
|
7
|
+
|
8
|
+
pipelines:
|
9
|
+
default:
|
10
|
+
- step:
|
11
|
+
script: # Modify the commands below to build your repository.
|
12
|
+
- bundler --version
|
13
|
+
- bundle install
|
14
|
+
- gem install byebug
|
15
|
+
- gem install rails -v 4.2.7.1
|
16
|
+
- gem install sqlite3
|
17
|
+
- rake test
|
data/doc/CHANGELOG
CHANGED
@@ -4,6 +4,14 @@ Redmine crm gem - general functions for plugins (tags, vote, viewing, currency)
|
|
4
4
|
Copyright (C) 2011-2017 RedmineUP
|
5
5
|
https://www.redmineup.com/
|
6
6
|
|
7
|
+
== 2017-05-23 v0.0.30
|
8
|
+
|
9
|
+
* Fixed votable vote_by
|
10
|
+
|
11
|
+
== 2017-03-21 v0.0.29
|
12
|
+
|
13
|
+
* Updated available_tags method
|
14
|
+
|
7
15
|
== 2017-03-17 v0.0.28
|
8
16
|
|
9
17
|
* Fixed bug with quote_value
|
@@ -86,21 +86,24 @@ module RedmineCrm
|
|
86
86
|
end
|
87
87
|
|
88
88
|
module SingletonMethods
|
89
|
-
#
|
90
|
-
#
|
91
|
-
def available_tags(
|
89
|
+
#Return all avalible tags for a project or global
|
90
|
+
#Example: Question.available_tags(:project => @project_id )
|
91
|
+
def available_tags(options = {})
|
92
|
+
project = options[:project]
|
93
|
+
limit = options[:limit].to_i.zero? ? 30 : options[:limit].to_i
|
92
94
|
scope = Tag.where({})
|
93
95
|
class_name = quote_string_value(base_class.name)
|
94
96
|
join = []
|
95
97
|
join << "JOIN #{Tagging.table_name} ON #{Tagging.table_name}.tag_id = #{Tag.table_name}.id "
|
96
98
|
join << "JOIN #{table_name} ON #{table_name}.id = #{Tagging.table_name}.taggable_id
|
97
99
|
AND #{Tagging.table_name}.taggable_type = #{class_name} "
|
98
|
-
if
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
100
|
+
if attribute_names.include?('project_id') && project
|
101
|
+
join << "JOIN #{Project.table_name} ON #{Project.table_name}.id = #{table_name}.project_id"
|
102
|
+
scope = scope.where("#{table_name}.project_id = ?", project.id)
|
103
|
+
end
|
104
|
+
|
105
|
+
if options[:name_like]
|
106
|
+
scope = scope.where("LOWER(#{Tag.table_name}.name) LIKE LOWER(?)", "%#{options[:name_like]}%")
|
104
107
|
end
|
105
108
|
|
106
109
|
group_fields = ''
|
@@ -112,7 +115,7 @@ module RedmineCrm
|
|
112
115
|
scope = scope.group("#{Tag.table_name}.id, #{Tag.table_name}.name #{group_fields}")
|
113
116
|
scope = scope.having('COUNT(*) > 0')
|
114
117
|
scope = scope.order("#{Tag.table_name}.name")
|
115
|
-
scope = scope.limit(limit)
|
118
|
+
scope = scope.limit(limit)
|
116
119
|
scope
|
117
120
|
end
|
118
121
|
# Returns an array of related tags.
|
@@ -77,12 +77,9 @@ module RedmineCrm
|
|
77
77
|
|
78
78
|
if votes_for.count == 0 || options[:duplicate]
|
79
79
|
# this voter has never voted
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
:vote_scope => options[:vote_scope],
|
84
|
-
:vote_ip => options[:vote_ip]
|
85
|
-
)
|
80
|
+
vote_params = { :votable => self, :voter => options[:voter], :vote_scope => options[:vote_scope] }
|
81
|
+
vote_params[:vote_ip] = options[:vote_ip] if options[:vote_ip]
|
82
|
+
vote = RedmineCrm::ActsAsVotable::Vote.new(vote_params)
|
86
83
|
else
|
87
84
|
# this voter is potentially changing his vote
|
88
85
|
vote = votes_for.last
|
data/lib/redmine_crm/version.rb
CHANGED
@@ -3,7 +3,7 @@ require File.dirname(__FILE__) + '/../test_helper'
|
|
3
3
|
class RcrmActsAsTaggableTest < ActiveSupport::TestCase
|
4
4
|
def test_available_tags
|
5
5
|
assert_equivalent [tags(:feature), tags(:bug), tags(:error), tags(:question)], Issue.available_tags(Project.first)
|
6
|
-
assert_equivalent [tags(:
|
6
|
+
assert_equivalent [tags(:error), tags(:question)], Issue.available_tags(:project => Project.first, :limit => 2)
|
7
7
|
end
|
8
8
|
|
9
9
|
def test_find_related_tags_with
|
@@ -330,7 +330,7 @@ class RcrmActsAsTaggableTest < ActiveSupport::TestCase
|
|
330
330
|
end
|
331
331
|
|
332
332
|
def test_quote_value
|
333
|
-
assert_equal "'RedmineCrm::ActsAsTaggable::Tag'", Issue.send(:quote_value, RedmineCrm::ActsAsTaggable::Tag)
|
333
|
+
assert_equal "'RedmineCrm::ActsAsTaggable::Tag'", Issue.send(:quote_value, RedmineCrm::ActsAsTaggable::Tag, nil)
|
334
334
|
end
|
335
335
|
|
336
336
|
def test_tags_condition
|
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.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RedmineUP
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid
|
@@ -36,6 +36,7 @@ files:
|
|
36
36
|
- Gemfile
|
37
37
|
- README.md
|
38
38
|
- Rakefile
|
39
|
+
- bitbucket-pipelines.yml
|
39
40
|
- config/currency_iso.json
|
40
41
|
- doc/CHANGELOG
|
41
42
|
- doc/LICENSE.txt
|