classiccms 0.4.0 → 0.4.1

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.
@@ -3,10 +3,7 @@ module Classiccms
3
3
 
4
4
  #in charge of get the first item of a given model (for menu items etc.)
5
5
  def get_first_item
6
- records = Base.where(:'connections.parent' => nil, :'connections.section' => CONFIG[:section], :_type => CONFIG[:model])
7
- if records.count > 0
8
- records.order_by(:'connections.order_id').first
9
- end
6
+ Base.where(:_type => CONFIG[:model], :connections.matches => {:parent => nil, :section => CONFIG[:section], :order_id.lte => 1}).first
10
7
  end
11
8
 
12
9
  #This method will get you the most awesome route through a tree! (OMG!)
@@ -110,7 +110,6 @@ class TopPanel
110
110
 
111
111
  create: (url) ->
112
112
  $j.post url, $j(@p.form).serialize(), (data) =>
113
- alert data
114
113
  if data == null
115
114
  window.location.reload()
116
115
  else
@@ -1,3 +1,3 @@
1
1
  module Classiccms #:nodoc
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
data/spec/helpers_spec.rb CHANGED
@@ -103,6 +103,7 @@ describe Classiccms do
103
103
  set_file "views/Menu/index.haml", "%h1 menu"
104
104
 
105
105
  m = Menu.create connections: [Connection.new(section: 'menu', file: 'index')]
106
+ m.connections
106
107
 
107
108
  get '/'
108
109
  last_response.body.should == "<h1>menu</h1>\n"
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.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: