layout position handling
Olli Huotari
committed Feb 09, 2012
commit a8b413e03e14d9c930de802670bfb33091c1402d
Showing 1
changed file with
1 additions
and 0 deletions
app/models/cms/layout.rb
+1
-0
| @@ | @@ -77,6 +77,7 @@ protected |
| end | |
| def assign_position | |
| + | return if self.position.to_i > 0 |
| max = self.site.layouts.where(:parent_id => self.parent_id).maximum(:position) | |
| self.position = max ? max + 1 : 0 | |
| end | |