redmine_crm 0.0.33 → 0.0.34
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/doc/CHANGELOG +4 -0
- data/lib/redmine_crm.rb +1 -1
- data/lib/redmine_crm/acts_as_taggable/rcrm_acts_as_taggable.rb +4 -2
- data/lib/redmine_crm/acts_as_votable/vote.rb +2 -2
- data/lib/redmine_crm/version.rb +1 -1
- data/test/acts_as_taggable/rcrm_acts_as_taggable_test.rb +4 -4
- data/test/acts_as_taggable/tag_test.rb +0 -9
- data/test/acts_as_votable/voter_test.rb +1 -1
- data/test/database.yml +4 -0
- data/test/fixtures/issue.rb +4 -0
- data/test/test_helper.rb +5 -6
- 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: b05a60d81fa656ebd71d75aa3871db0025c63242
|
4
|
+
data.tar.gz: 3ce1eb527b7b90f316bf5d0883b8d129b12d5045
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8673d2669a5948e9cc52cf1a294f3d4c6aafa8ff60a3c8346e02ceb03347909b15d5bfb70aa5cca9b7a8e0700f8dd9766924e4612b9cc4beb59e41b5f7d4b3c1
|
7
|
+
data.tar.gz: c99defa93349703c1e4bb22c87bb86de377a1c12b073f091e71da2246c64137684aac82d667bb9c6056d62c54ba928a4592f169f298d311605fdbd81c7e0a22d
|
data/doc/CHANGELOG
CHANGED
@@ -4,6 +4,10 @@ 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-12-22 v0.0.34
|
8
|
+
|
9
|
+
* Fixed bug with Redmine 2.x support
|
10
|
+
|
7
11
|
== 2017-12-18 v0.0.33
|
8
12
|
|
9
13
|
* Rails 5 support (Redmine 4)
|
data/lib/redmine_crm.rb
CHANGED
@@ -27,7 +27,7 @@ require 'redmine_crm/helpers/external_assets_helper'
|
|
27
27
|
require 'redmine_crm/assets_manager'
|
28
28
|
|
29
29
|
if defined?(ActiveRecord::Base)
|
30
|
-
ActiveRecord::Base.include
|
30
|
+
ActiveRecord::Base.send :include, RedmineCrm::ActsAsList::List
|
31
31
|
ActiveRecord::Base.extend(RedmineCrm::ActsAsVotable::Voter)
|
32
32
|
ActiveRecord::Base.extend(RedmineCrm::ActsAsVotable::Votable)
|
33
33
|
end
|
@@ -231,10 +231,11 @@ module RedmineCrm
|
|
231
231
|
# scope(:find)
|
232
232
|
|
233
233
|
conditions = []
|
234
|
-
conditions << send(:
|
235
|
-
conditions << send(:
|
234
|
+
conditions << send(:sanitize_sql_for_assignment, options.delete(:conditions)) if options[:conditions]
|
235
|
+
conditions << send(:sanitize_sql_for_assignment, scope) if scope
|
236
236
|
conditions << "#{Tagging.table_name}.taggable_type = #{quote_string_value(base_class.name)}"
|
237
237
|
conditions << type_condition unless descends_from_active_record?
|
238
|
+
conditions.delete('')
|
238
239
|
conditions.compact!
|
239
240
|
conditions = conditions.join(" AND ")
|
240
241
|
|
@@ -253,6 +254,7 @@ module RedmineCrm
|
|
253
254
|
end
|
254
255
|
|
255
256
|
private
|
257
|
+
|
256
258
|
def quote_string_value(object)
|
257
259
|
connection.quote(object)
|
258
260
|
end
|
@@ -18,8 +18,8 @@ module RedmineCrm
|
|
18
18
|
|
19
19
|
scope :up, lambda { where(:vote_flag => true) }
|
20
20
|
scope :down, lambda { where(:vote_flag => false) }
|
21
|
-
scope :for_type, lambda { |klass| where(:votable_type => klass) }
|
22
|
-
scope :by_type, lambda { |klass| where(:voter_type => klass) }
|
21
|
+
scope :for_type, lambda { |klass| where(:votable_type => klass.to_s) }
|
22
|
+
scope :by_type, lambda { |klass| where(:voter_type => klass.to_s) }
|
23
23
|
|
24
24
|
validates_presence_of :votable_id
|
25
25
|
validates_presence_of :voter_id
|
data/lib/redmine_crm/version.rb
CHANGED
@@ -175,8 +175,8 @@ class RcrmActsAsTaggableTest < ActiveSupport::TestCase
|
|
175
175
|
options = Issue.find_options_for_tag_counts(:start_at => 2.weeks.ago, :end_at => Date.today)
|
176
176
|
sql = options.values.join(' ')
|
177
177
|
|
178
|
-
assert_no_match
|
179
|
-
assert_no_match
|
178
|
+
assert_no_match %r{taggings}, sql
|
179
|
+
assert_no_match %r{tags}, sql
|
180
180
|
|
181
181
|
assert_match /categorisations/, sql
|
182
182
|
assert_match /categories/, sql
|
@@ -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)
|
334
334
|
end
|
335
335
|
|
336
336
|
def test_tags_condition
|
@@ -342,6 +342,6 @@ class RcrmActsAsTaggableTest < ActiveSupport::TestCase
|
|
342
342
|
issues(:first_issue).tag_list.remove('error')
|
343
343
|
issues(:first_issue).tag_list.add('new')
|
344
344
|
issues(:first_issue).save!
|
345
|
-
assert_equal %w(question new), issues(:first_issue).all_tags_list
|
345
|
+
assert_equal %w(question new), issues(:first_issue).reload.all_tags_list
|
346
346
|
end
|
347
347
|
end
|
@@ -60,15 +60,6 @@ module RedmineCrm
|
|
60
60
|
assert_tag_counts Tag.counts(:conditions => ['taggings.created_at >= ?', '2015-01-01']),
|
61
61
|
:question => 3, :error => 2, :feature => 1, :bug => 1
|
62
62
|
end
|
63
|
-
|
64
|
-
def test_all_counts_with_hash_conditions
|
65
|
-
tag_counts = Tag.counts(
|
66
|
-
:conditions => {
|
67
|
-
:taggings => { :created_at => (DateTime.parse('2014-12-31 23:59') .. DateTime.parse('4000-01-01')) }
|
68
|
-
}
|
69
|
-
)
|
70
|
-
assert_tag_counts tag_counts, :question => 3, :error => 2, :feature => 1, :bug => 1
|
71
|
-
end
|
72
63
|
end
|
73
64
|
end
|
74
65
|
end
|
@@ -138,7 +138,7 @@ class VoterTest < ActiveSupport::TestCase
|
|
138
138
|
|
139
139
|
def test_get_all_of_the_voters_up_votes_for_a_class
|
140
140
|
votable.vote_by(:voter => voter)
|
141
|
-
votables(:votable2).vote_by(
|
141
|
+
votables(:votable2).vote_by(:voter => voter, :vote => false)
|
142
142
|
assert_equal voter.find_up_votes_for_class(votable_klass).size, 1
|
143
143
|
assert_equal voter.votes.up.for_type(votable_klass).count, 1
|
144
144
|
end
|
data/test/database.yml
CHANGED
data/test/fixtures/issue.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -6,10 +6,9 @@ begin
|
|
6
6
|
require File.dirname(__FILE__) + '/../../../../config/environment'
|
7
7
|
rescue LoadError
|
8
8
|
require 'rubygems'
|
9
|
-
gem 'activerecord'
|
10
|
-
gem 'actionpack'
|
9
|
+
gem 'activerecord'
|
10
|
+
gem 'actionpack'
|
11
11
|
require 'active_record'
|
12
|
-
# require 'action_controller'
|
13
12
|
end
|
14
13
|
require "redmine_crm"
|
15
14
|
require "active_record/fixtures"
|
@@ -40,10 +39,10 @@ load(File.dirname(__FILE__) + '/fixtures/project.rb')
|
|
40
39
|
class ActiveSupport::TestCase #:nodoc:
|
41
40
|
include ActiveRecord::TestFixtures
|
42
41
|
|
43
|
-
self.fixture_path = File.dirname(__FILE__) +
|
42
|
+
self.fixture_path = File.dirname(__FILE__) + '/fixtures/'
|
44
43
|
|
45
|
-
self.
|
46
|
-
self.use_instantiated_fixtures
|
44
|
+
self.use_transactional_tests = true
|
45
|
+
self.use_instantiated_fixtures = false
|
47
46
|
set_fixture_class :tags => RedmineCrm::ActsAsTaggable::Tag
|
48
47
|
set_fixture_class :taggings => RedmineCrm::ActsAsTaggable::Tagging
|
49
48
|
|
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.34
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RedmineUP
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid
|