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