classiccms 0.5.11 → 0.5.12
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/classiccms/lib/routing.rb +5 -1
- data/lib/classiccms/version.rb +1 -1
- metadata +1 -1
@@ -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]
|
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!)
|
data/lib/classiccms/version.rb
CHANGED