Fix position for new habits

This commit is contained in:
2016-03-04 12:07:01 -05:00
parent 616322cd35
commit 5e7636d7ff

View File

@@ -83,7 +83,7 @@ public class Habit extends Model
public Habit()
{
this.color = ColorHelper.palette[5];
this.position = Habit.count();
this.position = Habit.countWithArchived();
this.highlight = 0;
this.archived = 0;
this.freqDen = 7;
@@ -132,6 +132,11 @@ public class Habit extends Model
return select().count();
}
public static int countWithArchived()
{
return selectWithArchived().count();
}
public static java.util.List<Habit> getHighlightedHabits()
{
return select().where("highlight = 1")