Continue to look for recipes in disabled books

Update models so that when a recipe book is disabled, it no longer is
used for finding names to display in the UI, but it is still used for
finding recipes to make.
This commit is contained in:
Andrew Miner
2014-12-29 12:38:07 -08:00
parent 004320d052
commit 2dd4b7014f
3 changed files with 1 additions and 5 deletions
-4
View File
@@ -23,8 +23,6 @@ module.exports = class RecipeBook extends BaseModel
# Public Methods ############################################################################### # Public Methods ###############################################################################
gatherNames: (result)-> gatherNames: (result)->
return unless @enabled
for recipe in @recipes for recipe in @recipes
continue if result[recipe.name] continue if result[recipe.name]
result[recipe.name] = value:recipe.name, label:"#{recipe.name} (from #{@modName} #{@modVersion})" result[recipe.name] = value:recipe.name, label:"#{recipe.name} (from #{@modName} #{@modVersion})"
@@ -32,8 +30,6 @@ module.exports = class RecipeBook extends BaseModel
return result return result
gatherRecipes: (name, result)-> gatherRecipes: (name, result)->
return unless @enabled
for recipe in @recipes for recipe in @recipes
if recipe.name is name if recipe.name is name
result.push recipe result.push recipe
+1
View File
@@ -24,6 +24,7 @@ module.exports = class RecipeCatalog extends BaseModel
gatherNames: -> gatherNames: ->
nameData = {} nameData = {}
for book in @books for book in @books
continue unless book.enabled
book.gatherNames nameData book.gatherNames nameData
result = [] result = []
-1
View File
@@ -17,4 +17,3 @@
td td
input.recipe_book_url(placeholder="enter a URL to load another recipe book...") input.recipe_book_url(placeholder="enter a URL to load another recipe book...")
button.recipe_book_load_button Load button.recipe_book_load_button Load
.load_error: p