start vue conversion

This commit is contained in:
Dan Elbert 2018-03-29 01:57:00 -05:00
parent dea393d514
commit 1c4fbe15de
46 changed files with 12879 additions and 303 deletions

18
.babelrc Normal file
View File

@ -0,0 +1,18 @@
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": "> 1%",
"uglify": true
},
"useBuiltIns": true
}]
],
"plugins": [
"syntax-dynamic-import",
"transform-object-rest-spread",
["transform-class-properties", { "spec": true }]
]
}

5
.gitignore vendored
View File

@ -22,3 +22,8 @@
/public/assets
.DS_Store
/public/packs
/public/packs-test
/node_modules
yarn-debug.log*
.yarn-integrity

3
.postcssrc.yml Normal file
View File

@ -0,0 +1,3 @@
plugins:
postcss-import: {}
postcss-cssnext: {}

View File

@ -1 +1 @@
2.4.3
2.5.1

View File

@ -1,4 +1,4 @@
FROM phusion/passenger-ruby24:latest
FROM phusion/passenger-ruby25:latest
# Use baseimage-docker's init process.
CMD ["/sbin/my_init"]

28
Gemfile
View File

@ -1,23 +1,25 @@
source 'https://rubygems.org'
gem 'rails', '5.0.6'
gem 'rails', '5.2.0.rc2'
gem 'sqlite3'
gem 'pg', '~> 0.21.0'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
# gem 'sass-rails', '~> 5.0'
# gem 'uglifier', '>= 1.3.0'
gem 'puma'
gem 'puma', '~> 3.11'
# See https://github.com/rails/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby
# gem 'therubyracer', platforms: :ruby
gem 'webpacker', '3.4.1'
gem 'bootsnap', '>= 1.1.0', require: false
# Use jquery as the JavaScript library
gem 'jquery-rails', '~> 4.3.1'
gem 'bootstrap-sass', '~> 3.3.7'
gem 'kaminari', '~> 1.1.1'
gem 'turbolinks', '~> 5.1.0'
# gem 'jquery-rails', '~> 4.3.1'
# gem 'bootstrap-sass', '~> 3.3.7'
# gem 'kaminari', '~> 1.1.1'
# gem 'turbolinks', '~> 5.1.0'
gem 'jbuilder', '~> 2.7'
gem 'cocoon', '~> 1.2.9'
# gem 'cocoon', '~> 1.2.9'
gem 'unitwise', '~> 2.2.0'
gem 'redcarpet', '~> 3.4.0'
@ -30,9 +32,9 @@ group :development, :test do
gem 'guard', '~> 2.14.0'
gem 'guard-rspec', require: false
gem 'rspec-rails', '~> 3.5.0'
gem 'rspec-rails', '~> 3.7.2'
gem 'rails-controller-testing'
gem 'factory_girl_rails', '~> 4.8.0'
gem 'database_cleaner', '~> 1.5.3'
gem 'factory_bot_rails', '~> 4.8.2'
gem 'database_cleaner', '~> 1.6.2'
end

View File

@ -1,63 +1,62 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (5.0.6)
actionpack (= 5.0.6)
nio4r (>= 1.2, < 3.0)
websocket-driver (~> 0.6.1)
actionmailer (5.0.6)
actionpack (= 5.0.6)
actionview (= 5.0.6)
activejob (= 5.0.6)
actioncable (5.2.0.rc2)
actionpack (= 5.2.0.rc2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.0.rc2)
actionpack (= 5.2.0.rc2)
actionview (= 5.2.0.rc2)
activejob (= 5.2.0.rc2)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.0.6)
actionview (= 5.0.6)
activesupport (= 5.0.6)
actionpack (5.2.0.rc2)
actionview (= 5.2.0.rc2)
activesupport (= 5.2.0.rc2)
rack (~> 2.0)
rack-test (~> 0.6.3)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.0.6)
activesupport (= 5.0.6)
actionview (5.2.0.rc2)
activesupport (= 5.2.0.rc2)
builder (~> 3.1)
erubis (~> 2.7.0)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.0.6)
activesupport (= 5.0.6)
activejob (5.2.0.rc2)
activesupport (= 5.2.0.rc2)
globalid (>= 0.3.6)
activemodel (5.0.6)
activesupport (= 5.0.6)
activerecord (5.0.6)
activemodel (= 5.0.6)
activesupport (= 5.0.6)
arel (~> 7.0)
activesupport (5.0.6)
activemodel (5.2.0.rc2)
activesupport (= 5.2.0.rc2)
activerecord (5.2.0.rc2)
activemodel (= 5.2.0.rc2)
activesupport (= 5.2.0.rc2)
arel (>= 9.0)
activestorage (5.2.0.rc2)
actionpack (= 5.2.0.rc2)
activerecord (= 5.2.0.rc2)
marcel (~> 0.3.1)
activesupport (5.2.0.rc2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
arel (7.1.4)
autoprefixer-rails (8.1.0.1)
execjs
arel (9.0.0)
bcrypt (3.1.11)
bootstrap-sass (3.3.7)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
bootsnap (1.2.1)
msgpack (~> 1.0)
builder (3.2.3)
cocoon (1.2.11)
coderay (1.1.2)
concurrent-ruby (1.0.5)
crass (1.0.3)
database_cleaner (1.5.3)
database_cleaner (1.6.2)
diff-lcs (1.3)
erubis (2.7.0)
execjs (2.7.0)
factory_girl (4.8.1)
erubi (1.7.1)
factory_bot (4.8.2)
activesupport (>= 3.0.0)
factory_girl_rails (4.8.0)
factory_girl (~> 4.8.0)
factory_bot_rails (4.8.2)
factory_bot (~> 4.8.2)
railties (>= 3.0.0)
ffi (1.9.23)
formatador (0.2.5)
@ -77,45 +76,32 @@ GEM
guard (~> 2.1)
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
i18n (0.9.5)
i18n (1.0.0)
concurrent-ruby (~> 1.0)
jbuilder (2.7.0)
activesupport (>= 4.2.0)
multi_json (>= 1.2)
jquery-rails (4.3.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
kaminari (1.1.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.1.1)
kaminari-activerecord (= 1.1.1)
kaminari-core (= 1.1.1)
kaminari-actionview (1.1.1)
actionview
kaminari-core (= 1.1.1)
kaminari-activerecord (1.1.1)
activerecord
kaminari-core (= 1.1.1)
kaminari-core (1.1.1)
libv8 (3.16.14.19)
liner (0.2.4)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
loofah (2.2.1)
loofah (2.2.2)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
lumberjack (1.0.12)
mail (2.7.0)
mini_mime (>= 0.1.1)
marcel (0.3.2)
mimemagic (~> 0.3.2)
memoizable (0.4.2)
thread_safe (~> 0.3, >= 0.3.1)
method_source (0.9.0)
mimemagic (0.3.2)
mini_mime (1.0.0)
mini_portile2 (2.3.0)
minitest (5.11.3)
msgpack (1.2.4)
multi_json (1.13.1)
nenv (0.3.0)
nio4r (2.3.0)
@ -131,19 +117,22 @@ GEM
method_source (~> 0.9.0)
puma (3.11.3)
rack (2.0.4)
rack-test (0.6.3)
rack (>= 1.0)
rails (5.0.6)
actioncable (= 5.0.6)
actionmailer (= 5.0.6)
actionpack (= 5.0.6)
actionview (= 5.0.6)
activejob (= 5.0.6)
activemodel (= 5.0.6)
activerecord (= 5.0.6)
activesupport (= 5.0.6)
rack-proxy (0.6.4)
rack
rack-test (1.0.0)
rack (>= 1.0, < 3)
rails (5.2.0.rc2)
actioncable (= 5.2.0.rc2)
actionmailer (= 5.2.0.rc2)
actionpack (= 5.2.0.rc2)
actionview (= 5.2.0.rc2)
activejob (= 5.2.0.rc2)
activemodel (= 5.2.0.rc2)
activerecord (= 5.2.0.rc2)
activestorage (= 5.2.0.rc2)
activesupport (= 5.2.0.rc2)
bundler (>= 1.3.0)
railties (= 5.0.6)
railties (= 5.2.0.rc2)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.2)
actionpack (~> 5.x, >= 5.0.1)
@ -152,53 +141,41 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
railties (5.0.6)
actionpack (= 5.0.6)
activesupport (= 5.0.6)
rails-html-sanitizer (1.0.4)
loofah (~> 2.2, >= 2.2.2)
railties (5.2.0.rc2)
actionpack (= 5.2.0.rc2)
activesupport (= 5.2.0.rc2)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (12.3.0)
rake (12.3.1)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
redcarpet (3.4.0)
ref (2.0.0)
rspec (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-core (3.5.4)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
rspec (3.7.0)
rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0)
rspec-mocks (~> 3.7.0)
rspec-core (3.7.1)
rspec-support (~> 3.7.0)
rspec-expectations (3.7.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-mocks (3.5.0)
rspec-support (~> 3.7.0)
rspec-mocks (3.7.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-rails (3.5.2)
rspec-support (~> 3.7.0)
rspec-rails (3.7.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0)
rspec-mocks (~> 3.7.0)
rspec-support (~> 3.7.0)
rspec-support (3.7.1)
ruby_dep (1.5.0)
sass (3.5.5)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sass-rails (5.0.7)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
shellany (0.0.1)
signed_multiset (0.2.1)
sprockets (3.7.1)
@ -209,27 +186,22 @@ GEM
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.13)
therubyracer (0.12.3)
libv8 (~> 3.16.14.15)
ref
thor (0.20.0)
thread_safe (0.3.6)
tilt (2.0.8)
turbolinks (5.1.0)
turbolinks-source (~> 5.1)
turbolinks-source (5.1.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
tzinfo-data (1.2018.3)
tzinfo-data (1.2018.4)
tzinfo (>= 1.0.0)
uglifier (4.1.8)
execjs (>= 0.3.0, < 3)
unitwise (2.2.0)
liner (~> 0.2)
memoizable (~> 0.4)
parslet (~> 1.5)
signed_multiset (~> 0.2)
websocket-driver (0.6.5)
webpacker (3.4.1)
activesupport (>= 4.2)
rack-proxy (>= 0.6.1)
railties (>= 4.2)
websocket-driver (0.7.0)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
@ -238,28 +210,22 @@ PLATFORMS
DEPENDENCIES
bcrypt (~> 3.1.11)
bootstrap-sass (~> 3.3.7)
cocoon (~> 1.2.9)
database_cleaner (~> 1.5.3)
factory_girl_rails (~> 4.8.0)
bootsnap (>= 1.1.0)
database_cleaner (~> 1.6.2)
factory_bot_rails (~> 4.8.2)
guard (~> 2.14.0)
guard-rspec
jbuilder (~> 2.7)
jquery-rails (~> 4.3.1)
kaminari (~> 1.1.1)
pg (~> 0.21.0)
puma
rails (= 5.0.6)
puma (~> 3.11)
rails (= 5.2.0.rc2)
rails-controller-testing
redcarpet (~> 3.4.0)
rspec-rails (~> 3.5.0)
sass-rails (~> 5.0)
rspec-rails (~> 3.7.2)
sqlite3
therubyracer
turbolinks (~> 5.1.0)
tzinfo-data
uglifier (>= 1.3.0)
unitwise (~> 2.2.0)
webpacker (= 3.4.1)
BUNDLED WITH
1.16.1

View File

@ -1,4 +1,9 @@
class HomeController < ApplicationController
def index
render layout: false
end
def about
end

22
app/javascript/app.vue Normal file
View File

@ -0,0 +1,22 @@
<template>
<div id="app">
<p>{{ message }}</p>
</div>
</template>
<script>
export default {
data: function () {
return {
message: "Hello Vue!"
}
}
}
</script>
<style scoped>
p {
font-size: 2em;
text-align: center;
}
</style>

View File

@ -0,0 +1,13 @@
<template>
<div id="app">
<router-view></router-view>
</div>
</template>
<script>
export default {
}
</script>

View File

@ -0,0 +1,14 @@
<template>
<div>
<h1>404!</h1>
<p>WTF?</p>
</div>
</template>
<script>
export default {
}
</script>

View File

@ -0,0 +1,13 @@
<template>
<div>
list
</div>
</template>
<script>
export default {
}
</script>

4
app/javascript/config.js Normal file
View File

@ -0,0 +1,4 @@
export default {
baseApiUrl: null
}

View File

@ -0,0 +1,25 @@
import '../styles';
import Vue from 'vue'
import config from '../config';
/// import 'App/lib/Fontawesome';
import store from '../store';
import router from '../router';
import App from '../components/App';
//Vue.use(VueClipboard);
//sync(store, router);
document.addEventListener('DOMContentLoaded', () => {
const app = document.getElementById('app');
config.baseApiUrl = app.dataset.url;
window.$vm = new Vue({
el: '#app',
store,
router,
render: createElement => createElement('App'),
components: { App }
});
});

21
app/javascript/router.js Normal file
View File

@ -0,0 +1,21 @@
import Vue from 'vue';
import Router from 'vue-router';
import The404Page from './components/The404Page';
import TheRecipeList from './components/TheRecipeList';
Vue.use(Router);
export default new Router({
routes: [
{
path: '/',
name: 'recipeList',
component: TheRecipeList
},
{
path: '*',
component: The404Page
}
]
})

View File

@ -0,0 +1,3 @@
export default {};

View File

View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Parsley</title>
<%= stylesheet_pack_tag 'application' %>
</head>
<body>
<div id="app" data-url="<%= root_url %>">
Loading...
</div>
<%= javascript_pack_tag 'application' %>
</body>
</html>

15
bin/webpack Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env ruby
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
ENV["NODE_ENV"] ||= ENV["RAILS_ENV"]
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
require "rubygems"
require "bundler/setup"
require "webpacker"
require "webpacker/webpack_runner"
Webpacker::WebpackRunner.run(ARGV)

15
bin/webpack-dev-server Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env ruby
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
ENV["NODE_ENV"] ||= ENV["RAILS_ENV"]
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
require "rubygems"
require "bundler/setup"
require "webpacker"
require "webpacker/dev_server_runner"
Webpacker::DevServerRunner.run(ARGV)

View File

@ -1,4 +1,6 @@
Rails.application.configure do
# Verifies that versions and hashed value of the package contents in the project's package.json
config.webpacker.check_yarn_integrity = true
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on

View File

@ -1,4 +1,6 @@
Rails.application.configure do
# Verifies that versions and hashed value of the package contents in the project's package.json
config.webpacker.check_yarn_integrity = false
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.

View File

@ -1,23 +0,0 @@
# Be sure to restart your server when you modify this file.
#
# This file contains migration options to ease your Rails 5.0 upgrade.
#
# Once upgraded flip defaults one by one to migrate to the new default.
#
# Read the Rails 5.0 release notes for more info on each option.
# Enable per-form CSRF tokens. Previous versions had false.
Rails.application.config.action_controller.per_form_csrf_tokens = false
# Enable origin-checking CSRF mitigation. Previous versions had false.
Rails.application.config.action_controller.forgery_protection_origin_check = false
# Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
# Previous versions had false.
ActiveSupport.to_time_preserves_timezone = false
# Require `belongs_to` associations by default. Previous versions had false.
Rails.application.config.active_record.belongs_to_required_by_default = false
# Do not halt callback chains when a callback returns false. Previous versions had true.
ActiveSupport.halt_callback_chains_on_return_false = true

View File

@ -48,7 +48,7 @@ Rails.application.routes.draw do
resources :users, except: [:new, :create]
end
root 'recipes#index'
root 'home#index'
end

View File

@ -0,0 +1,3 @@
const environment = require('./environment')
module.exports = environment.toWebpackConfig()

View File

@ -0,0 +1,5 @@
const { environment } = require('@rails/webpacker');
const vue = require('./loaders/vue');
environment.loaders.append('vue', vue)
module.exports = environment;

View File

@ -0,0 +1,13 @@
const { dev_server: devServer } = require('@rails/webpacker').config
const isProduction = process.env.NODE_ENV === 'production'
const inDevServer = process.argv.find(v => v.includes('webpack-dev-server'))
const extractCSS = !(inDevServer && (devServer && devServer.hmr)) || isProduction
module.exports = {
test: /\.vue(\.erb)?$/,
use: [{
loader: 'vue-loader',
options: { extractCSS }
}]
}

View File

@ -0,0 +1,3 @@
const environment = require('./environment')
module.exports = environment.toWebpackConfig()

3
config/webpack/test.js Normal file
View File

@ -0,0 +1,3 @@
const environment = require('./environment')
module.exports = environment.toWebpackConfig()

69
config/webpacker.yml Normal file
View File

@ -0,0 +1,69 @@
# Note: You must restart bin/webpack-dev-server for changes to take effect
default: &default
source_path: app/javascript
source_entry_path: packs
public_output_path: packs
cache_path: tmp/cache/webpacker
# Additional paths webpack should lookup modules
# ['app/assets', 'engine/foo/app/assets']
resolved_paths: []
# Reload manifest.json on all requests so we reload latest compiled packs
cache_manifest: false
extensions:
- .vue
- .js
- .sass
- .scss
- .css
- .module.sass
- .module.scss
- .module.css
- .png
- .svg
- .gif
- .jpeg
- .jpg
development:
<<: *default
compile: true
# Reference: https://webpack.js.org/configuration/dev-server/
dev_server:
https: false
host: localhost
port: 3035
public: localhost:3035
hmr: false
# Inline should be set to true if using HMR
inline: true
overlay: true
compress: true
disable_host_check: true
use_local_ip: false
quiet: false
headers:
'Access-Control-Allow-Origin': '*'
watch_options:
ignored: /node_modules/
test:
<<: *default
compile: true
# Compile test packs to a separate directory
public_output_path: packs-test
production:
<<: *default
# Production depends on precompilation of packs prior to booting for performance.
compile: false
# Cache manifest.json for performance
cache_manifest: true

View File

@ -10,105 +10,105 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170414233856) do
ActiveRecord::Schema.define(version: 2017_04_14_233856) do
create_table "ingredient_units", force: :cascade do |t|
t.integer "ingredient_id", null: false
t.string "name", null: false
t.decimal "gram_weight", precision: 10, scale: 2, null: false
t.integer "ingredient_id", null: false
t.string "name", null: false
t.decimal "gram_weight", precision: 10, scale: 2, null: false
t.index ["ingredient_id"], name: "index_ingredient_units_on_ingredient_id"
end
create_table "ingredients", force: :cascade do |t|
t.string "name"
t.string "density"
t.text "notes"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "ndbn", limit: 5
t.decimal "water", precision: 10, scale: 2
t.decimal "protein", precision: 10, scale: 2
t.decimal "lipids", precision: 10, scale: 2
t.decimal "ash", precision: 10, scale: 2
t.decimal "carbohydrates", precision: 10, scale: 2
t.integer "kcal"
t.decimal "fiber", precision: 10, scale: 1
t.decimal "sugar", precision: 10, scale: 2
t.integer "user_id"
t.integer "calcium"
t.decimal "iron", precision: 10, scale: 2
t.integer "magnesium"
t.integer "phosphorus"
t.integer "potassium"
t.integer "sodium"
t.decimal "zinc", precision: 10, scale: 2
t.decimal "copper", precision: 10, scale: 3
t.decimal "manganese", precision: 10, scale: 3
t.decimal "vit_c", precision: 10, scale: 1
t.decimal "vit_b6", precision: 10, scale: 3
t.decimal "vit_b12", precision: 10, scale: 2
t.integer "vit_a"
t.decimal "vit_e", precision: 10, scale: 2
t.decimal "vit_d", precision: 10, scale: 1
t.decimal "vit_k", precision: 10, scale: 1
t.decimal "cholesterol", precision: 10, scale: 3
t.string "name"
t.string "density"
t.text "notes"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "ndbn", limit: 5
t.decimal "water", precision: 10, scale: 2
t.decimal "protein", precision: 10, scale: 2
t.decimal "lipids", precision: 10, scale: 2
t.decimal "ash", precision: 10, scale: 2
t.decimal "carbohydrates", precision: 10, scale: 2
t.integer "kcal"
t.decimal "fiber", precision: 10, scale: 1
t.decimal "sugar", precision: 10, scale: 2
t.integer "user_id"
t.integer "calcium"
t.decimal "iron", precision: 10, scale: 2
t.integer "magnesium"
t.integer "phosphorus"
t.integer "potassium"
t.integer "sodium"
t.decimal "zinc", precision: 10, scale: 2
t.decimal "copper", precision: 10, scale: 3
t.decimal "manganese", precision: 10, scale: 3
t.decimal "vit_c", precision: 10, scale: 1
t.decimal "vit_b6", precision: 10, scale: 3
t.decimal "vit_b12", precision: 10, scale: 2
t.integer "vit_a"
t.decimal "vit_e", precision: 10, scale: 2
t.decimal "vit_d", precision: 10, scale: 1
t.decimal "vit_k", precision: 10, scale: 1
t.decimal "cholesterol", precision: 10, scale: 3
end
create_table "logs", force: :cascade do |t|
t.integer "user_id"
t.integer "recipe_id"
t.integer "source_recipe_id"
t.integer "user_id"
t.integer "recipe_id"
t.integer "source_recipe_id"
t.datetime "date"
t.integer "rating"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.text "notes"
t.integer "rating"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.text "notes"
end
create_table "notes", force: :cascade do |t|
t.integer "user_id", null: false
t.text "content", null: false
t.integer "user_id", null: false
t.text "content", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["user_id"], name: "index_notes_on_user_id"
end
create_table "recipe_ingredients", force: :cascade do |t|
t.integer "ingredient_id"
t.integer "recipe_id"
t.string "name"
t.integer "sort_order"
t.string "quantity"
t.string "units"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.text "preparation"
t.integer "ingredient_id"
t.integer "recipe_id"
t.string "name"
t.integer "sort_order"
t.string "quantity"
t.string "units"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.text "preparation"
t.index ["recipe_id"], name: "index_recipe_ingredients_on_recipe_id"
end
create_table "recipe_steps", force: :cascade do |t|
t.integer "recipe_id"
t.integer "sort_order"
t.text "step"
t.integer "recipe_id"
t.integer "sort_order"
t.text "step"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["recipe_id"], name: "index_recipe_steps_on_recipe_id"
end
create_table "recipes", force: :cascade do |t|
t.string "name"
t.text "description"
t.text "source"
t.string "yields"
t.integer "total_time"
t.integer "active_time"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "deleted"
t.integer "user_id"
t.boolean "is_log"
t.float "rating"
t.text "step_text"
t.string "name"
t.text "description"
t.text "source"
t.string "yields"
t.integer "total_time"
t.integer "active_time"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "deleted"
t.integer "user_id"
t.boolean "is_log"
t.float "rating"
t.text "step_text"
end
create_table "recipes_tags", id: false, force: :cascade do |t|
@ -119,73 +119,73 @@ ActiveRecord::Schema.define(version: 20170414233856) do
end
create_table "tags", force: :cascade do |t|
t.string "name"
t.string "lowercase_name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "name"
t.string "lowercase_name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["lowercase_name"], name: "index_tags_on_lowercase_name", unique: true
end
create_table "usda_food_weights", force: :cascade do |t|
t.integer "usda_food_id", null: false
t.decimal "amount", precision: 7, scale: 3
t.string "description"
t.decimal "gram_weight", precision: 7, scale: 1
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "usda_food_id", null: false
t.decimal "amount", precision: 7, scale: 3
t.string "description"
t.decimal "gram_weight", precision: 7, scale: 1
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["usda_food_id"], name: "index_usda_food_weights_on_usda_food_id"
end
create_table "usda_foods", force: :cascade do |t|
t.string "ndbn", limit: 5, null: false
t.string "long_description"
t.string "short_description"
t.decimal "water", precision: 10, scale: 2
t.integer "kcal"
t.decimal "protein", precision: 10, scale: 2
t.decimal "lipid", precision: 10, scale: 2
t.decimal "ash", precision: 10, scale: 2
t.decimal "carbohydrates", precision: 10, scale: 2
t.decimal "fiber", precision: 10, scale: 1
t.decimal "sugar", precision: 10, scale: 2
t.decimal "gram_weight_1", precision: 9, scale: 2
t.decimal "gram_weight_2", precision: 9, scale: 2
t.string "gram_weight_desc_1"
t.string "gram_weight_desc_2"
t.string "refuse_description"
t.integer "refuse_percent"
t.string "scientific_name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "calcium"
t.decimal "iron", precision: 10, scale: 2
t.integer "magnesium"
t.integer "phosphorus"
t.integer "potassium"
t.integer "sodium"
t.decimal "zinc", precision: 10, scale: 2
t.decimal "copper", precision: 10, scale: 3
t.decimal "manganese", precision: 10, scale: 3
t.decimal "vit_c", precision: 10, scale: 1
t.decimal "vit_b6", precision: 10, scale: 3
t.decimal "vit_b12", precision: 10, scale: 2
t.integer "vit_a"
t.decimal "vit_e", precision: 10, scale: 2
t.decimal "vit_d", precision: 10, scale: 1
t.decimal "vit_k", precision: 10, scale: 1
t.decimal "cholesterol", precision: 10, scale: 3
t.string "ndbn", limit: 5, null: false
t.string "long_description"
t.string "short_description"
t.decimal "water", precision: 10, scale: 2
t.integer "kcal"
t.decimal "protein", precision: 10, scale: 2
t.decimal "lipid", precision: 10, scale: 2
t.decimal "ash", precision: 10, scale: 2
t.decimal "carbohydrates", precision: 10, scale: 2
t.decimal "fiber", precision: 10, scale: 1
t.decimal "sugar", precision: 10, scale: 2
t.decimal "gram_weight_1", precision: 9, scale: 2
t.decimal "gram_weight_2", precision: 9, scale: 2
t.string "gram_weight_desc_1"
t.string "gram_weight_desc_2"
t.string "refuse_description"
t.integer "refuse_percent"
t.string "scientific_name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "calcium"
t.decimal "iron", precision: 10, scale: 2
t.integer "magnesium"
t.integer "phosphorus"
t.integer "potassium"
t.integer "sodium"
t.decimal "zinc", precision: 10, scale: 2
t.decimal "copper", precision: 10, scale: 3
t.decimal "manganese", precision: 10, scale: 3
t.decimal "vit_c", precision: 10, scale: 1
t.decimal "vit_b6", precision: 10, scale: 3
t.decimal "vit_b12", precision: 10, scale: 2
t.integer "vit_a"
t.decimal "vit_e", precision: 10, scale: 2
t.decimal "vit_d", precision: 10, scale: 1
t.decimal "vit_k", precision: 10, scale: 1
t.decimal "cholesterol", precision: 10, scale: 3
t.index ["long_description"], name: "index_usda_foods_on_long_description"
t.index ["ndbn"], name: "index_usda_foods_on_ndbn"
end
create_table "users", force: :cascade do |t|
t.string "username"
t.string "email"
t.string "full_name"
t.string "password_digest"
t.boolean "admin"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "username"
t.string "email"
t.string "full_name"
t.string "password_digest"
t.boolean "admin"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
end

16
package.json Normal file
View File

@ -0,0 +1,16 @@
{
"dependencies": {
"@rails/webpacker": "^3.4.1",
"caniuse-lite": "^1.0.30000815",
"css-loader": "^0.28.11",
"vue": "^2.5.16",
"vue-loader": "^14.2.2",
"vue-router": "^3.0.1",
"vue-template-compiler": "^2.5.16",
"vuex": "^3.0.1",
"webpack": "^3.11.0"
},
"devDependencies": {
"webpack-dev-server": "^2.11.2"
}
}

View File

@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do
factory :ingredient_unit do
ingredient
name 'Each'

View File

@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do
factory :ingredient do
name 'Ingredient'
density nil

View File

@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do
factory :log do
date "2016-07-06 20:13:14"
rating 1

View File

@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do
factory :note do
user
content "MyText"

View File

@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do
factory :recipe_ingredient do
sort_order 1
end

View File

@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do
factory :recipe do
name "Recipe"
description "desc"

View File

@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do
factory :tag do
sequence(:name) { |n| "tag#{n}" }
end

View File

@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do
factory :usda_food_weight do
amount 1

View File

@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do
sequence :unique_ndbn do |n|
n.to_s.rjust(5, '0')

View File

@ -1,4 +1,4 @@
FactoryGirl.define do
FactoryBot.define do
sequence :generic_email do |n|
"generic_email_#{n.to_s.rjust(3, '0')}@example.com"

View File

@ -89,7 +89,7 @@ RSpec.describe UnitConversion do
'1/3 c' => Unitwise("1/3".to_r, 'cup'),
'-5/16 g' => Unitwise("-5/16".to_r, 'gram'),
'2 1/2 c' => Unitwise("5/2".to_r, 'cup'),
'1.03 gram/ml' => Unitwise(1.03, 'gram/milliliter')
'1.03 gram/ml' => Unitwise(1.03, 'g/ml')
}
data.each do |input, output|

View File

@ -29,7 +29,7 @@ ActiveRecord::Migration.maintain_test_schema!
RSpec.configure do |config|
config.include FactoryGirl::Syntax::Methods
config.include FactoryBot::Syntax::Methods
config.before(:suite) do
DatabaseCleaner.strategy = :transaction
@ -38,7 +38,7 @@ RSpec.configure do |config|
DatabaseCleaner.clean_with(:truncation)
DatabaseCleaner.cleaning do
FactoryGirl.lint
FactoryBot.lint
end
end
end

6183
yarn-error.log Normal file

File diff suppressed because it is too large Load Diff

6137
yarn.lock Normal file

File diff suppressed because it is too large Load Diff