classiccms 0.3.5 → 0.3.6

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.
@@ -48,7 +48,7 @@ module Classiccms
48
48
  end
49
49
  post '/destroy' do
50
50
  items = Base.where(_id: params[:id])
51
- items.first.delete if items.count > 0
51
+ items.first.destroy if items.count > 0
52
52
  end
53
53
  post '/sort' do
54
54
  section = params[:section]
@@ -36,7 +36,7 @@ module Classiccms
36
36
  #renders a specific page
37
37
  def layout(section_name, position)
38
38
  id = get_parent_id(position)
39
- records = Base.where(:'connection.parent_id' => id)
39
+ records = Base.where(:_id => id)
40
40
  if records.count > 0 and records.first.connections.where(:section => section_name, :file.ne => nil).count > 0
41
41
  file_name = records.first.connections.where(:section => section_name, :file.ne => nil).first.file
42
42
  show "#{records.first._type}/#{file_name}", {}, {record: records.first}
@@ -1,3 +1,3 @@
1
1
  module Classiccms #:nodoc
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
data/spec/helpers_spec.rb CHANGED
@@ -77,20 +77,20 @@ describe Classiccms do
77
77
  describe 'layout helper' do
78
78
  it 'should return 404 when section does not exist' do
79
79
  @routes = [Menu.create.id]
80
- layout('menu', 0).should == '404'
80
+ layout('menu', 1).should == '404'
81
81
  end
82
82
  it 'should return when there are no records' do
83
83
  @routes = []
84
- layout('menu', 0).should == '404'
84
+ layout('menu', 1).should == '404'
85
85
  end
86
86
  it 'should return 404 when section exist but no file name is given' do
87
87
  m = Menu.create(connections: [Connection.new(section: 'menu')])
88
88
  @routes = [m.id]
89
- layout('menu', 0).should == '404'
89
+ layout('menu', 1).should == '404'
90
90
  end
91
- it 'should return 404 when file does not exist' do
91
+ it 'should return the rendered file' do
92
92
  with_constants :CONFIG => {home: 'application/index4', model: 'Menu', section: 'menu'} do
93
- set_file "views/application/index4.haml", "= layout 'menu', 0"
93
+ set_file "views/application/index4.haml", "= layout 'menu', 1"
94
94
  create_dir 'views/Menu'
95
95
  set_file "views/Menu/index.haml", "%h1 menu"
96
96
 
@@ -102,7 +102,7 @@ describe Classiccms do
102
102
  end
103
103
  it 'should also pass the current record' do
104
104
  with_constants :CONFIG => {home: 'application/index4', model: 'Menu', section: 'menu'} do
105
- set_file "views/application/index4.haml", "= layout 'menu', 0"
105
+ set_file "views/application/index4.haml", "= layout 'menu', 1"
106
106
  create_dir 'views/menu'
107
107
  set_file "views/menu/record.haml", "%h1= record.id"
108
108
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: classiccms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: