honey-cms 0.3.10 → 0.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/cms/type.rb CHANGED
@@ -6,7 +6,8 @@ class CMS::Type
6
6
  def initialize name, attributes, options = {}
7
7
  @name = name
8
8
  @attributes = attributes
9
- @options = options.symbolize_keys.merge(timestamps: true, indexes: true)
9
+ @options = options.symbolize_keys.merge(timestamps: true, indexes: true, model: true)
10
+ @options.merge!(@options.delete(:options).symbolize_keys) if @options[:options].present?
10
11
  @references = []
11
12
  end
12
13
 
@@ -17,7 +17,10 @@ module CMS
17
17
  CMS::Configuration.scoped_types(options).each do |type|
18
18
  @name = (@type = type).model_name
19
19
  template 'type_controller.rb', "app/controllers/cms/#{@name.collection}_controller.rb"
20
- template 'type_model.rb', "app/models/cms/#{@name.element}.rb"
20
+
21
+ if @type.options[:model]
22
+ template 'type_model.rb', "app/models/cms/#{@name.element}.rb"
23
+ end
21
24
 
22
25
  %w(index new show edit _fields).each do |view|
23
26
  template "views/#{view}.html.haml", "app/views/cms/#{@name.collection}/#{view}.html.haml"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honey-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.10
4
+ version: 0.3.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: