simplec 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/simplec/subdomain.rb +22 -22
- data/lib/simplec/action_view/helper.rb +1 -1
- data/lib/simplec/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce0da33bd0574dc9288baa128b2918d05d74c3fb
|
4
|
+
data.tar.gz: 9c8341d59b7c72583b58ea732d8d908a3dca44f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e84bdb48ac2c173c24f1e3e90374af79eb8b5766b98aa757faa63b2dd4e63e3326e5fe141f9e3c77979ca9c29b7b9bbccb42162b49f1567122146b89f4cbd426
|
7
|
+
data.tar.gz: 83b7f65eef77523950a15c38f1ca6738c7019655f9c2fc4703d004c52d51555adfe909ab3cd9cccb779f4fd6b012e933c93adffa40cc20ccf82173dc4ce584dd
|
@@ -1,30 +1,30 @@
|
|
1
1
|
module Simplec
|
2
2
|
class Subdomain < ApplicationRecord
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
has_many :pages
|
4
|
+
has_and_belongs_to_many :document_sets
|
5
|
+
has_and_belongs_to_many :documents
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
validates :name,
|
8
|
+
presence: true,
|
9
|
+
exclusion: { in: %w(admin) }
|
10
|
+
validates :default_layout,
|
11
|
+
inclusion: {in: :layouts, allow_blank: true}
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
def layouts
|
14
|
+
@layouts ||= Dir[Rails.root.join('app/views/layouts').to_s + "/*.html.*"].
|
15
|
+
map{|n| File.basename(n).split('.', 2).first }.
|
16
|
+
reject{|n| n =~ /\A_/ || n =~ /mailer/ || n =~ /application/ || n =~ /sessions/}. # TODO application and session should be removed and added to a config option
|
17
|
+
sort
|
18
|
+
end
|
19
19
|
|
20
|
-
|
20
|
+
module Normalizers
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
22
|
+
# Force lowercase name
|
23
|
+
#
|
24
|
+
def name=(val)
|
25
|
+
super (val ? val.to_s.strip.downcase : val)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
prepend Normalizers
|
29
29
|
end
|
30
30
|
end
|
data/lib/simplec/version.rb
CHANGED