classiccms 0.5.11 → 0.5.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,11 @@ 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
- Base.where(:_type => CONFIG[:model], :'connections.parrent' => nil, :'connections.section' => CONFIG[:section], :'connections.order_id'.lte => 1).first
6
+ Base.where(:_type => CONFIG[:model]).each do |item|
7
+ if item.connections.where(:parent_id => nil, :section => CONFIG[:section], :order_id.lte => 1).count > 0
8
+ return item
9
+ end
10
+ end
7
11
  end
8
12
 
9
13
  #This method will get you the most awesome route through a tree! (OMG!)
@@ -1,3 +1,3 @@
1
1
  module Classiccms #:nodoc
2
- VERSION = "0.5.11"
2
+ VERSION = "0.5.12"
3
3
  end
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.5.11
4
+ version: 0.5.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: