Fix position for new habits

pull/30/head
Alinson S. Xavier 10 years ago
parent 616322cd35
commit 5e7636d7ff

@ -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")

Loading…
Cancel
Save