simplec 0.9.2 → 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: cf3503ea710deb1367ab8d1f8551e763a2aa601999dc5c0972b5388832e78276
|
4
|
+
data.tar.gz: 1674c53aba72fd917fd222cff94e80a6bd52f9c53df9d25a1c1da7d71fbb24e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2a23e2fb5b4a0aad5e152e5e4c15c54e80befe6b97d170aec70bace826a20b3fd66136ce1541344074c735da0f41ef956b4a2d798e04fa8c528de1fa59db5b2
|
7
|
+
data.tar.gz: f1f3bbc20c9325dc508a8616c826ca8de435abaeb879dda569cdc1b841331ffb801bfdce2fe2bf3ec5b65799160f6fcfb20e6ea8c8284232247a1c0d2ab6b04d
|
@@ -6,7 +6,7 @@ module Simplec
|
|
6
6
|
not_admin = request.subdomain != 'admin'
|
7
7
|
subdomain = Simplec::Subdomain.find_by(name: request.subdomain)
|
8
8
|
|
9
|
-
match = simplec || (present && not_admin && subdomain)
|
9
|
+
match = simplec || (present && not_admin && subdomain && subdomain.published)
|
10
10
|
|
11
11
|
if match
|
12
12
|
Thread.current[:simplec_subdomain] = subdomain
|
@@ -16,11 +16,19 @@ Simplec request received.
|
|
16
16
|
Simplec Engine: #{not_admin}
|
17
17
|
LOG
|
18
18
|
else
|
19
|
-
|
19
|
+
if subdomain && !subdomain.published
|
20
|
+
Rails.logger.info <<-LOG
|
21
|
+
Simplec Subdomain '#{request.subdomain}' found, but not published.
|
22
|
+
ActionDispatch::Request#original_url: #{request.original_url}
|
23
|
+
'admin' subdomain bypass: #{!not_admin}
|
24
|
+
LOG
|
25
|
+
else
|
26
|
+
Rails.logger.info <<-LOG
|
20
27
|
Simplec Subdomain '#{request.subdomain}' was not found.
|
21
28
|
ActionDispatch::Request#original_url: #{request.original_url}
|
22
29
|
'admin' subdomain bypass: #{!not_admin}
|
23
30
|
LOG
|
31
|
+
end
|
24
32
|
end
|
25
33
|
|
26
34
|
match
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class AddPublishedToSimplecSubdomains < ActiveRecord::Migration[5.1]
|
2
|
+
def change
|
3
|
+
add_column :simplec_subdomains, :published, :boolean,
|
4
|
+
default: false
|
5
|
+
add_index :simplec_subdomains, :published
|
6
|
+
|
7
|
+
reversible do |dir|
|
8
|
+
dir.up {
|
9
|
+
execute <<-SQL.strip.gsub(/\s+/, ' ')
|
10
|
+
UPDATE simplec_subdomains
|
11
|
+
SET published = true;
|
12
|
+
SQL
|
13
|
+
}
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/simplec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -156,6 +156,7 @@ files:
|
|
156
156
|
- db/migrate/20170814211816_create_simplec_documents.rb
|
157
157
|
- db/migrate/20170814211929_create_simplec_document_sets.rb
|
158
158
|
- db/migrate/20170917144923_add_search_to_simplec_pages.rb
|
159
|
+
- db/migrate/20180608205153_add_published_to_simplec_subdomains.rb
|
159
160
|
- lib/simplec.rb
|
160
161
|
- lib/simplec/action_controller/extensions.rb
|
161
162
|
- lib/simplec/action_view/helper.rb
|