activeadmin-selleo-cms 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,6 +13,7 @@ module ActiveadminSelleoCms
13
13
  accepts_nested_attributes_for :translations, :sections, :children
14
14
 
15
15
  validates_format_of :link_url, with: /^http/i, allow_blank: false, if: ->(page) { page.is_link_url }
16
+ validates_presence_of :layout
16
17
 
17
18
  scope :show_in_menu, where(show_in_menu: true)
18
19
  scope :published, where(is_published: true)
@@ -22,7 +23,6 @@ module ActiveadminSelleoCms
22
23
 
23
24
  before_validation do
24
25
  self.slug = self.title.parameterize if title and slug.blank?
25
- self.layout = 'application' unless layout
26
26
  end
27
27
 
28
28
  before_save do
@@ -32,7 +32,7 @@ module ActiveadminSelleoCms
32
32
  end
33
33
 
34
34
  after_initialize do
35
- self.layout = Layout.all.first if new_record?
35
+ self.layout = Layout.all.first if new_record? and layout.blank?
36
36
  end
37
37
 
38
38
  def initialize_missing_sections
@@ -1,3 +1,3 @@
1
1
  module ActiveadminSelleoCms
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin-selleo-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: