pages_cms 2.3.1 → 2.3.2

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
  SHA1:
3
- metadata.gz: b1d8e40a08b90874d9c0018904a0f35284ae192a
4
- data.tar.gz: 49847e2314b9311a61a101a5a76a480816c5537c
3
+ metadata.gz: 83d9122d822001c70fd71c92536a9addfd33259e
4
+ data.tar.gz: 557bb0a3680f40ed83ebbd653c500ce5bd68401c
5
5
  SHA512:
6
- metadata.gz: a37622ed0c4b48c01e1acc5060ad493993fda11fddc476d1bdbedb118c65f34bdcda7ad4bef13c9ab2d183e6dd46548278d6cedd063a08ccccfa4d7c45b21c17
7
- data.tar.gz: 7275866ae92cb97f5f016e45818c4ddc69e9084069335c2f7f6b9c24e59276479e603881d2ee373de14f708cf91c6f4073e10de4796feb69b4d01194781206c7
6
+ metadata.gz: 89e20948af6c2393be3cb422b005c8c420c746c5d36b8daf7642e967f4aa5c1a265a0b720d36966b5daced25d13502a0cb519ad1dc370059e85b5c14a694f815
7
+ data.tar.gz: aedef50c6f1ea061287f904ffd16966efbf3801c57a01bbf487bbcbd0b4f30c75131f47e03f542ea9d06d13cacee1148cbfe3b7d867ec8bd8c204f360e38ed87
data/config/routes.rb CHANGED
@@ -13,34 +13,25 @@ PagesCms::Engine.routes.draw do
13
13
  post '/pages/order' => 'pages#order'
14
14
  post '/accounts/site' => 'accounts#site'
15
15
  end
16
-
17
- # # mainly for deploying to heroku, keeps it from throwing an error before the db is deployed.
18
- # def db_exists?
19
- # ActiveRecord::Base.connection
20
- # rescue ActiveRecord::NoDatabaseError
21
- # false
22
- # else
23
- # true
24
- # end
25
- # db_exists? &&
26
-
27
- # draws all the routes for the CMS. The root account (raccount) is drawn last to avoid conflicts.
28
- # :slug is the main way to identify the page, as well as the account.id.
29
- if PagesCms.const_defined?('Account')
30
- accounts = PagesCms::Account.where("mount_location != '/'")
31
- raccount = PagesCms::Account.find_by(mount_location: '/')
32
- if accounts
33
- accounts.each do |account|
34
- get "/#{account.mount_location}/:parent/:slug" => 'pages#show', account: account.id
35
- get "/#{account.mount_location}/:slug" => 'pages#show', account: account.id
36
- get "/#{account.mount_location}/" => 'pages#home', account: account.id
16
+ begin
17
+ if PagesCms.const_defined?('Account')
18
+ accounts = PagesCms::Account.where("mount_location != '/'")
19
+ raccount = PagesCms::Account.find_by(mount_location: '/')
20
+ if accounts
21
+ accounts.each do |account|
22
+ get "/#{account.mount_location}/:parent/:slug" => 'pages#show', account: account.id
23
+ get "/#{account.mount_location}/:slug" => 'pages#show', account: account.id
24
+ get "/#{account.mount_location}/" => 'pages#home', account: account.id
25
+ end
26
+ end
27
+ if raccount
28
+ get '/:parent/:slug' => 'pages#show', account: raccount.id, root: true
29
+ get '/:slug' => 'pages#show', account: raccount.id, root: true
30
+ get '/' => 'pages#home', account: raccount.id, root: true, as: :root
37
31
  end
38
32
  end
39
- if raccount
40
- get '/:parent/:slug' => 'pages#show', account: raccount.id, root: true
41
- get '/:slug' => 'pages#show', account: raccount.id, root: true
42
- get '/' => 'pages#home', account: raccount.id, root: true, as: :root
43
- end
33
+ rescue Exception => e
34
+ nil
44
35
  end
45
36
 
46
37
  end
@@ -1,3 +1,3 @@
1
1
  module PagesCms
2
- VERSION = '2.3.1'
2
+ VERSION = '2.3.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pages_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin Walker