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: d5b8ea5b96bff494112424c200b279792510b182b5f4257532b51c0cbab55456
4
- data.tar.gz: b3f51e5e8b47228b7d5c6e20f7ee629623a9928749a75f740a744c2110308336
3
+ metadata.gz: cf3503ea710deb1367ab8d1f8551e763a2aa601999dc5c0972b5388832e78276
4
+ data.tar.gz: 1674c53aba72fd917fd222cff94e80a6bd52f9c53df9d25a1c1da7d71fbb24e6
5
5
  SHA512:
6
- metadata.gz: 80537e4ead797944467ebc0f49bc3944637922b532200704f3e60647bebe8a695477f85700094b4f8b8cfdd460cf193e8997ac97575cc2bdafc01a2dfd49da6f
7
- data.tar.gz: 8912a37ff6adac737267014c5430cf206ad58ff89aba050e7d03a5e474011a1e80a8e62820feb7f43ce246610d7b256992979af813270e6fcbda3d4a36d11f15
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
- Rails.logger.info <<-LOG
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
@@ -1,3 +1,3 @@
1
1
  module Simplec
2
- VERSION = '0.9.2'
2
+ VERSION = '0.10.0'
3
3
  end
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.9.2
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-05-04 00:00:00.000000000 Z
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