Fix position for new habits
This commit is contained in:
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…
Reference in New Issue
Block a user