classiccms 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -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
|
-
|
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!)
|
data/lib/classiccms/version.rb
CHANGED
data/spec/helpers_spec.rb
CHANGED