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
|
-
|
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