diff --git a/Gemfile.lock b/Gemfile.lock index 1c40e79..080225b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -61,11 +61,11 @@ GEM tzinfo (~> 2.0) zeitwerk (~> 2.3) bcrypt (3.1.16) - bootsnap (1.7.5) - msgpack (~> 1.0) + bootsnap (1.10.3) + msgpack (~> 1.2) builder (3.2.4) coderay (1.1.3) - concurrent-ruby (1.1.8) + concurrent-ruby (1.1.9) crass (1.0.6) dalli (2.7.11) database_cleaner (2.0.1) @@ -74,17 +74,17 @@ GEM activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) - diff-lcs (1.4.4) + diff-lcs (1.5.0) erubi (1.10.0) factory_bot (6.2.0) activesupport (>= 5.0.0) factory_bot_rails (6.2.0) factory_bot (~> 6.2.0) railties (>= 5.0.0) - ffi (1.15.0) - formatador (0.2.5) - globalid (0.4.2) - activesupport (>= 4.2.0) + ffi (1.15.5) + formatador (1.1.0) + globalid (1.0.0) + activesupport (>= 5.0) guard (2.16.2) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) @@ -99,57 +99,57 @@ GEM guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) - i18n (1.8.10) + i18n (1.9.1) concurrent-ruby (~> 1.0) - kaminari (1.2.1) + kaminari (1.2.2) activesupport (>= 4.1.0) - kaminari-actionview (= 1.2.1) - kaminari-activerecord (= 1.2.1) - kaminari-core (= 1.2.1) - kaminari-actionview (1.2.1) + kaminari-actionview (= 1.2.2) + kaminari-activerecord (= 1.2.2) + kaminari-core (= 1.2.2) + kaminari-actionview (1.2.2) actionview - kaminari-core (= 1.2.1) - kaminari-activerecord (1.2.1) + kaminari-core (= 1.2.2) + kaminari-activerecord (1.2.2) activerecord - kaminari-core (= 1.2.1) - kaminari-core (1.2.1) + kaminari-core (= 1.2.2) + kaminari-core (1.2.2) liner (0.2.4) - listen (3.5.1) + listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.9.1) + loofah (2.13.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) lumberjack (1.2.8) mail (2.7.1) mini_mime (>= 0.1.1) - marcel (1.0.1) + marcel (1.0.2) memoizable (0.4.2) thread_safe (~> 0.3, >= 0.3.1) method_source (1.0.0) mini_mime (1.0.3) - mini_portile2 (2.5.1) - minitest (5.14.4) - msgpack (1.4.2) + mini_portile2 (2.7.1) + minitest (5.15.0) + msgpack (1.4.4) nenv (0.3.0) - nio4r (2.5.7) - nokogiri (1.11.3) - mini_portile2 (~> 2.5.0) + nio4r (2.5.8) + nokogiri (1.13.1) + mini_portile2 (~> 2.7.0) racc (~> 1.4) notiffany (0.1.3) nenv (~> 0.1) shellany (~> 0.0) - oj (3.11.5) + oj (3.11.8) parslet (1.8.2) pg (1.2.3) pry (0.14.1) coderay (~> 1.1) method_source (~> 1.0) - puma (5.3.0) + puma (5.6.1) nio4r (~> 2.0) - racc (1.5.2) + racc (1.6.0) rack (2.2.3) - rack-proxy (0.6.5) + rack-proxy (0.7.2) rack rack-test (1.1.0) rack (>= 1.0, < 3) @@ -175,7 +175,7 @@ GEM rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.3.0) + rails-html-sanitizer (1.4.2) loofah (~> 2.3) railties (6.1.3.2) actionpack (= 6.1.3.2) @@ -183,7 +183,7 @@ GEM method_source rake (>= 0.8.7) thor (~> 1.0) - rake (13.0.3) + rake (13.0.6) rb-fsevent (0.11.0) rb-inotify (0.10.1) ffi (~> 1.0) @@ -192,15 +192,15 @@ GEM rspec-core (~> 3.10.0) rspec-expectations (~> 3.10.0) rspec-mocks (~> 3.10.0) - rspec-core (3.10.1) + rspec-core (3.10.2) rspec-support (~> 3.10.0) - rspec-expectations (3.10.1) + rspec-expectations (3.10.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.10.0) - rspec-mocks (3.10.2) + rspec-mocks (3.10.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.10.0) - rspec-rails (5.0.1) + rspec-rails (5.0.3) actionpack (>= 5.2) activesupport (>= 5.2) railties (>= 5.2) @@ -208,23 +208,23 @@ GEM rspec-expectations (~> 3.10) rspec-mocks (~> 3.10) rspec-support (~> 3.10) - rspec-support (3.10.2) + rspec-support (3.10.3) semantic_range (3.0.0) shellany (0.0.1) signed_multiset (0.2.1) sprockets (4.0.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.2.2) - actionpack (>= 4.0) - activesupport (>= 4.0) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) sprockets (>= 3.0.0) sqlite3 (1.4.2) - thor (1.1.0) + thor (1.2.1) thread_safe (0.3.6) tzinfo (2.0.4) concurrent-ruby (~> 1.0) - tzinfo-data (1.2021.1) + tzinfo-data (1.2021.5) tzinfo (>= 1.0.0) unitwise (2.2.0) liner (~> 0.2) @@ -236,10 +236,10 @@ GEM rack-proxy (>= 0.6.1) railties (>= 5.2) semantic_range (>= 2.3.0) - websocket-driver (0.7.3) + websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.4.2) + zeitwerk (2.5.4) PLATFORMS ruby diff --git a/app/javascript/components/RecipeShow.vue b/app/javascript/components/RecipeShow.vue index 5065b47..a68bf55 100644 --- a/app/javascript/components/RecipeShow.vue +++ b/app/javascript/components/RecipeShow.vue @@ -188,7 +188,7 @@ ...mapState([ 'taskLists' ]), - + timeDisplay() { let a = this.formatMinutes(this.recipe.active_time); const t = this.formatMinutes(this.recipe.total_time); @@ -216,7 +216,7 @@ if (this.isSourceUrl) { return this.sourceUrl.host; } else { - return this.source; + return this.recipe.source; } } }, @@ -238,20 +238,19 @@ ...mapActions([ 'ensureTaskLists' ]), - + ...mapMutations([ 'setCurrentTaskList' ]), addRecipeToList(list) { - console.log(list); api.addRecipeToTaskList(list.id, this.recipe.id) .then(() => { this.setCurrentTaskList(list); this.$router.push({name: 'task_lists'}) }); }, - + convert() { this.showConvertDialog = false; this.$router.push({name: 'recipe', query: { scale: this.scaleValue, system: this.systemConvertValue, unit: this.unitConvertValue }}); @@ -287,7 +286,7 @@ } } }, - + mounted() { this.ensureTaskLists(); } @@ -296,4 +295,4 @@ \ No newline at end of file + diff --git a/app/models/task_list.rb b/app/models/task_list.rb index e0ce25f..ddb9b05 100644 --- a/app/models/task_list.rb +++ b/app/models/task_list.rb @@ -13,22 +13,22 @@ class TaskList < ApplicationRecord if recurse_depth > 10 raise "This shouldn't be. Did you make a recipe loop?" end - + recipe.recipe_ingredients.each do |ri| if ri.ingredient.is_a?(Recipe) add_recipe_ingredients(ri.ingredient, recurse_depth + 1) else - item = self.task_items.detect { |i| i.name.downcase == ri.name.downcase } || TaskItem.new(name: ri.name, task_list: self) + item = self.task_items.detect { |i| i.name.downcase == ri.name.downcase } || task_items.build(name: ri.name) quantity_str = [ri.quantity, ri.units].delete_if { |i| i.blank? }.join(' ') if item.quantity.blank? item.quantity = quantity_str else item.quantity += (', ' + quantity_str) end - + item.save end end end - + end