redmine_plugins_helper 0.9.4 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 747dc2f64ca0a3fdcbec5d50be57450f63a7c725654ee6dabee7e856c39ebac3
|
4
|
+
data.tar.gz: c7a1f9c07f653fec428625f5ab0486a313751b8940a322c98a6e14d34bcbafd8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dde27c9f58ac5cdf5cc87c231b374f9d68896ea9a85c3fdf370c73ccfbd37b3deaf8e0575622c941b10f3c6d32372c632329b1e0d784d8bdc82ec639edce174
|
7
|
+
data.tar.gz: 74ce1473a20c49d9910de3496a6eb07a92c5a9f26f0c4d6da6d4c9ada1fb511040079473898ea519b4a8574b946ace508c0dd49fa02c7d3af74df3a08b8f031a
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module RedminePluginsHelper
|
2
|
+
module Available
|
3
|
+
class << self
|
4
|
+
def database?
|
5
|
+
::ActiveRecord::Base.connection
|
6
|
+
rescue ActiveRecord::NoDatabaseError
|
7
|
+
false
|
8
|
+
else
|
9
|
+
true
|
10
|
+
end
|
11
|
+
|
12
|
+
def model?(model_class)
|
13
|
+
table?(model_class.table_name)
|
14
|
+
end
|
15
|
+
|
16
|
+
def table?(table_name)
|
17
|
+
database? && ::ActiveRecord::Base.connection.table_exists?(table_name)
|
18
|
+
end
|
19
|
+
|
20
|
+
def settings?
|
21
|
+
model?(::Setting)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_dependency 'redmine_plugins_helper'
|
3
|
+
require_dependency 'redmine_plugins_helper/available'
|
4
4
|
|
5
5
|
module RedminePluginsHelper
|
6
6
|
class Settings
|
7
7
|
class << self
|
8
8
|
def default(plugin, default)
|
9
|
-
return unless ::RedminePluginsHelper.
|
9
|
+
return unless ::RedminePluginsHelper::Available.settings?
|
10
10
|
|
11
11
|
p = plugin_current_setting_value(plugin)
|
12
12
|
default.each do |k, v|
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redmine_plugins_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- 0.
|
7
|
+
- 0.10.0
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
@@ -112,6 +112,7 @@ files:
|
|
112
112
|
- config/initializers/backport_pg_10_support_to_rails_4.rb
|
113
113
|
- init.rb
|
114
114
|
- lib/redmine_plugins_helper.rb
|
115
|
+
- lib/redmine_plugins_helper/available.rb
|
115
116
|
- lib/redmine_plugins_helper/fix_migrations.rb
|
116
117
|
- lib/redmine_plugins_helper/hooks/add_assets.rb
|
117
118
|
- lib/redmine_plugins_helper/migrate.rb
|