Depreciation 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- metadata +4 -120
- data/.gitignore +0 -23
- data/Gemfile +0 -54
- data/Gemfile.lock +0 -237
- data/README.md +0 -24
- data/Rakefile +0 -6
- data/app/assets/config/manifest.js +0 -3
- data/app/assets/images/.keep +0 -0
- data/app/assets/javascripts/application.js +0 -17
- data/app/assets/javascripts/brands.coffee +0 -3
- data/app/assets/javascripts/cable.js +0 -13
- data/app/assets/javascripts/channels/.keep +0 -0
- data/app/assets/stylesheets/application.css.scss +0 -17
- data/app/assets/stylesheets/brands.scss +0 -3
- data/app/channels/application_cable/channel.rb +0 -4
- data/app/channels/application_cable/connection.rb +0 -4
- data/app/controllers/application_controller.rb +0 -3
- data/app/controllers/brands_controller.rb +0 -43
- data/app/controllers/concerns/.keep +0 -0
- data/app/helpers/application_helper.rb +0 -2
- data/app/helpers/brands_helper.rb +0 -2
- data/app/jobs/application_job.rb +0 -2
- data/app/mailers/application_mailer.rb +0 -4
- data/app/models/application_record.rb +0 -3
- data/app/models/brand.rb +0 -5
- data/app/models/concerns/.keep +0 -0
- data/app/models/user.rb +0 -6
- data/app/models/variant.rb +0 -3
- data/app/views/brands/_form.html.erb +0 -4
- data/app/views/brands/edit.html.erb +0 -3
- data/app/views/brands/index.html.erb +0 -5
- data/app/views/brands/new.html.erb +0 -2
- data/app/views/brands/show.html.erb +0 -36
- data/app/views/devise/confirmations/new.html.erb +0 -16
- data/app/views/devise/mailer/confirmation_instructions.html.erb +0 -5
- data/app/views/devise/mailer/email_changed.html.erb +0 -7
- data/app/views/devise/mailer/password_change.html.erb +0 -3
- data/app/views/devise/mailer/reset_password_instructions.html.erb +0 -8
- data/app/views/devise/mailer/unlock_instructions.html.erb +0 -7
- data/app/views/devise/passwords/edit.html.erb +0 -19
- data/app/views/devise/passwords/new.html.erb +0 -15
- data/app/views/devise/registrations/edit.html.erb +0 -27
- data/app/views/devise/registrations/new.html.erb +0 -78
- data/app/views/devise/sessions/new.html.erb +0 -36
- data/app/views/devise/shared/_links.html.erb +0 -25
- data/app/views/devise/unlocks/new.html.erb +0 -16
- data/app/views/layouts/application.html.erb +0 -34
- data/app/views/layouts/mailer.html.erb +0 -13
- data/app/views/layouts/mailer.text.erb +0 -1
- data/bin/bundle +0 -3
- data/bin/rails +0 -4
- data/bin/rake +0 -4
- data/bin/setup +0 -38
- data/bin/update +0 -29
- data/bin/yarn +0 -11
- data/config.ru +0 -5
- data/config/application.rb +0 -18
- data/config/boot.rb +0 -3
- data/config/cable.yml +0 -10
- data/config/database.yml +0 -25
- data/config/environment.rb +0 -5
- data/config/environments/development.rb +0 -56
- data/config/environments/production.rb +0 -91
- data/config/environments/test.rb +0 -42
- data/config/initializers/application_controller_renderer.rb +0 -8
- data/config/initializers/assets.rb +0 -14
- data/config/initializers/backtrace_silencers.rb +0 -7
- data/config/initializers/cookies_serializer.rb +0 -5
- data/config/initializers/devise.rb +0 -283
- data/config/initializers/filter_parameter_logging.rb +0 -4
- data/config/initializers/inflections.rb +0 -16
- data/config/initializers/mime_types.rb +0 -4
- data/config/initializers/simple_form.rb +0 -170
- data/config/initializers/simple_form_bootstrap.rb +0 -155
- data/config/initializers/wrap_parameters.rb +0 -14
- data/config/locales/devise.en.yml +0 -64
- data/config/locales/en.yml +0 -33
- data/config/locales/simple_form.en.yml +0 -31
- data/config/puma.rb +0 -56
- data/config/routes.rb +0 -8
- data/config/secrets.yml +0 -32
- data/db/migrate/20180405123506_create_brands.rb +0 -9
- data/db/migrate/20180405124007_create_variants.rb +0 -18
- data/db/migrate/20180405142003_devise_create_users.rb +0 -44
- data/db/schema.rb +0 -83
- data/db/seeds.rb +0 -22
- data/lib/assets/.keep +0 -0
- data/lib/tasks/.keep +0 -0
- data/lib/templates/erb/scaffold/_form.html.erb +0 -14
- data/log/.keep +0 -0
- data/package.json +0 -7
- data/public/404.html +0 -67
- data/public/422.html +0 -67
- data/public/500.html +0 -66
- data/public/apple-touch-icon-precomposed.png +0 -0
- data/public/apple-touch-icon.png +0 -0
- data/public/favicon.ico +0 -0
- data/public/robots.txt +0 -1
- data/test/application_system_test_case.rb +0 -5
- data/test/controllers/.keep +0 -0
- data/test/controllers/brands_controller_test.rb +0 -7
- data/test/fixtures/.keep +0 -0
- data/test/fixtures/brands.yml +0 -7
- data/test/fixtures/files/.keep +0 -0
- data/test/fixtures/users.yml +0 -11
- data/test/fixtures/variants.yml +0 -23
- data/test/helpers/.keep +0 -0
- data/test/integration/.keep +0 -0
- data/test/mailers/.keep +0 -0
- data/test/models/.keep +0 -0
- data/test/models/brand_test.rb +0 -7
- data/test/models/user_test.rb +0 -7
- data/test/models/variant_test.rb +0 -7
- data/test/system/.keep +0 -0
- data/test/test_helper.rb +0 -10
- data/tmp/.keep +0 -0
- data/vendor/.keep +0 -0
data/db/schema.rb
DELETED
@@ -1,83 +0,0 @@
|
|
1
|
-
# This file is auto-generated from the current state of the database. Instead
|
2
|
-
# of editing this file, please use the migrations feature of Active Record to
|
3
|
-
# incrementally modify your database, and then regenerate this schema definition.
|
4
|
-
#
|
5
|
-
# Note that this schema.rb definition is the authoritative source for your
|
6
|
-
# database schema. If you need to create the application database on another
|
7
|
-
# system, you should be using db:schema:load, not running all the migrations
|
8
|
-
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
9
|
-
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
10
|
-
#
|
11
|
-
# It's strongly recommended that you check this file into your version control system.
|
12
|
-
|
13
|
-
ActiveRecord::Schema.define(version: 20180414204123) do
|
14
|
-
|
15
|
-
create_table "advertisements", force: :cascade do |t|
|
16
|
-
t.string "condition"
|
17
|
-
t.string "year"
|
18
|
-
t.string "regno"
|
19
|
-
t.float "kmdriven"
|
20
|
-
t.integer "ownercount"
|
21
|
-
t.float "price"
|
22
|
-
t.integer "users_id"
|
23
|
-
t.integer "variant_id"
|
24
|
-
t.datetime "created_at", null: false
|
25
|
-
t.datetime "updated_at", null: false
|
26
|
-
t.index ["users_id"], name: "index_advertisements_on_users_id"
|
27
|
-
t.index ["variant_id"], name: "index_advertisements_on_variant_id"
|
28
|
-
end
|
29
|
-
|
30
|
-
create_table "age_depreciations", force: :cascade do |t|
|
31
|
-
t.integer "age"
|
32
|
-
t.integer "depreciation"
|
33
|
-
t.datetime "created_at", null: false
|
34
|
-
t.datetime "updated_at", null: false
|
35
|
-
end
|
36
|
-
|
37
|
-
create_table "brands", force: :cascade do |t|
|
38
|
-
t.string "name"
|
39
|
-
t.datetime "created_at", null: false
|
40
|
-
t.datetime "updated_at", null: false
|
41
|
-
end
|
42
|
-
|
43
|
-
create_table "mileage_depreciations", force: :cascade do |t|
|
44
|
-
t.integer "kms"
|
45
|
-
t.integer "depreciation"
|
46
|
-
t.datetime "created_at", null: false
|
47
|
-
t.datetime "updated_at", null: false
|
48
|
-
end
|
49
|
-
|
50
|
-
create_table "users", force: :cascade do |t|
|
51
|
-
t.string "email", default: "", null: false
|
52
|
-
t.string "encrypted_password", default: "", null: false
|
53
|
-
t.string "reset_password_token"
|
54
|
-
t.datetime "reset_password_sent_at"
|
55
|
-
t.datetime "remember_created_at"
|
56
|
-
t.integer "sign_in_count", default: 0, null: false
|
57
|
-
t.datetime "current_sign_in_at"
|
58
|
-
t.datetime "last_sign_in_at"
|
59
|
-
t.string "current_sign_in_ip"
|
60
|
-
t.string "last_sign_in_ip"
|
61
|
-
t.datetime "created_at", null: false
|
62
|
-
t.datetime "updated_at", null: false
|
63
|
-
t.index ["email"], name: "index_users_on_email", unique: true
|
64
|
-
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
65
|
-
end
|
66
|
-
|
67
|
-
create_table "variants", force: :cascade do |t|
|
68
|
-
t.string "name"
|
69
|
-
t.integer "enginecap"
|
70
|
-
t.integer "year"
|
71
|
-
t.string "fueltype"
|
72
|
-
t.string "gearshift"
|
73
|
-
t.integer "fuelcap"
|
74
|
-
t.integer "seating"
|
75
|
-
t.float "mileage"
|
76
|
-
t.float "price"
|
77
|
-
t.integer "brand_id"
|
78
|
-
t.datetime "created_at", null: false
|
79
|
-
t.datetime "updated_at", null: false
|
80
|
-
t.index ["brand_id"], name: "index_variants_on_brand_id"
|
81
|
-
end
|
82
|
-
|
83
|
-
end
|
data/db/seeds.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# This file should contain all the record creation needed to seed the database with its default values.
|
2
|
-
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
|
3
|
-
#
|
4
|
-
# Examples:
|
5
|
-
#
|
6
|
-
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
|
7
|
-
# Character.create(name: 'Luke', movie: movies.first)
|
8
|
-
<<-DOC
|
9
|
-
age_dep = [100,75,65,60,50,45,35,28,22,20,18,15,12,10,8,8,7,7,6,6,5]
|
10
|
-
kms_dep = [100,80,75,70,67,65,60,55,53,50,48,44,40,36,34,30,28,26,24,22,20,19,18,17,16,15,14,13,12,11,10]
|
11
|
-
i = 0
|
12
|
-
while i < kms_dep.length
|
13
|
-
MileageDepreciation.create(id: i+1, kms: i, depreciation: kms_dep[i])
|
14
|
-
i = i+1
|
15
|
-
end
|
16
|
-
i = 0
|
17
|
-
while i < age_dep.length do
|
18
|
-
AgeDepreciation.create(id: i+1, age: i, depreciation: age_dep[i])
|
19
|
-
i = i+1
|
20
|
-
end
|
21
|
-
|
22
|
-
DOC
|
data/lib/assets/.keep
DELETED
File without changes
|
data/lib/tasks/.keep
DELETED
File without changes
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<%# frozen_string_literal: true %>
|
2
|
-
<%%= simple_form_for(@<%= singular_table_name %>) do |f| %>
|
3
|
-
<%%= f.error_notification %>
|
4
|
-
|
5
|
-
<div class="form-inputs">
|
6
|
-
<%- attributes.each do |attribute| -%>
|
7
|
-
<%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
|
8
|
-
<%- end -%>
|
9
|
-
</div>
|
10
|
-
|
11
|
-
<div class="form-actions">
|
12
|
-
<%%= f.button :submit %>
|
13
|
-
</div>
|
14
|
-
<%% end %>
|
data/log/.keep
DELETED
File without changes
|
data/package.json
DELETED
data/public/404.html
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
-
<style>
|
7
|
-
.rails-default-error-page {
|
8
|
-
background-color: #EFEFEF;
|
9
|
-
color: #2E2F30;
|
10
|
-
text-align: center;
|
11
|
-
font-family: arial, sans-serif;
|
12
|
-
margin: 0;
|
13
|
-
}
|
14
|
-
|
15
|
-
.rails-default-error-page div.dialog {
|
16
|
-
width: 95%;
|
17
|
-
max-width: 33em;
|
18
|
-
margin: 4em auto 0;
|
19
|
-
}
|
20
|
-
|
21
|
-
.rails-default-error-page div.dialog > div {
|
22
|
-
border: 1px solid #CCC;
|
23
|
-
border-right-color: #999;
|
24
|
-
border-left-color: #999;
|
25
|
-
border-bottom-color: #BBB;
|
26
|
-
border-top: #B00100 solid 4px;
|
27
|
-
border-top-left-radius: 9px;
|
28
|
-
border-top-right-radius: 9px;
|
29
|
-
background-color: white;
|
30
|
-
padding: 7px 12% 0;
|
31
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
-
}
|
33
|
-
|
34
|
-
.rails-default-error-page h1 {
|
35
|
-
font-size: 100%;
|
36
|
-
color: #730E15;
|
37
|
-
line-height: 1.5em;
|
38
|
-
}
|
39
|
-
|
40
|
-
.rails-default-error-page div.dialog > p {
|
41
|
-
margin: 0 0 1em;
|
42
|
-
padding: 1em;
|
43
|
-
background-color: #F7F7F7;
|
44
|
-
border: 1px solid #CCC;
|
45
|
-
border-right-color: #999;
|
46
|
-
border-left-color: #999;
|
47
|
-
border-bottom-color: #999;
|
48
|
-
border-bottom-left-radius: 4px;
|
49
|
-
border-bottom-right-radius: 4px;
|
50
|
-
border-top-color: #DADADA;
|
51
|
-
color: #666;
|
52
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
-
}
|
54
|
-
</style>
|
55
|
-
</head>
|
56
|
-
|
57
|
-
<body class="rails-default-error-page">
|
58
|
-
<!-- This file lives in public/404.html -->
|
59
|
-
<div class="dialog">
|
60
|
-
<div>
|
61
|
-
<h1>The page you were looking for doesn't exist.</h1>
|
62
|
-
<p>You may have mistyped the address or the page may have moved.</p>
|
63
|
-
</div>
|
64
|
-
<p>If you are the application owner check the logs for more information.</p>
|
65
|
-
</div>
|
66
|
-
</body>
|
67
|
-
</html>
|
data/public/422.html
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>The change you wanted was rejected (422)</title>
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
-
<style>
|
7
|
-
.rails-default-error-page {
|
8
|
-
background-color: #EFEFEF;
|
9
|
-
color: #2E2F30;
|
10
|
-
text-align: center;
|
11
|
-
font-family: arial, sans-serif;
|
12
|
-
margin: 0;
|
13
|
-
}
|
14
|
-
|
15
|
-
.rails-default-error-page div.dialog {
|
16
|
-
width: 95%;
|
17
|
-
max-width: 33em;
|
18
|
-
margin: 4em auto 0;
|
19
|
-
}
|
20
|
-
|
21
|
-
.rails-default-error-page div.dialog > div {
|
22
|
-
border: 1px solid #CCC;
|
23
|
-
border-right-color: #999;
|
24
|
-
border-left-color: #999;
|
25
|
-
border-bottom-color: #BBB;
|
26
|
-
border-top: #B00100 solid 4px;
|
27
|
-
border-top-left-radius: 9px;
|
28
|
-
border-top-right-radius: 9px;
|
29
|
-
background-color: white;
|
30
|
-
padding: 7px 12% 0;
|
31
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
-
}
|
33
|
-
|
34
|
-
.rails-default-error-page h1 {
|
35
|
-
font-size: 100%;
|
36
|
-
color: #730E15;
|
37
|
-
line-height: 1.5em;
|
38
|
-
}
|
39
|
-
|
40
|
-
.rails-default-error-page div.dialog > p {
|
41
|
-
margin: 0 0 1em;
|
42
|
-
padding: 1em;
|
43
|
-
background-color: #F7F7F7;
|
44
|
-
border: 1px solid #CCC;
|
45
|
-
border-right-color: #999;
|
46
|
-
border-left-color: #999;
|
47
|
-
border-bottom-color: #999;
|
48
|
-
border-bottom-left-radius: 4px;
|
49
|
-
border-bottom-right-radius: 4px;
|
50
|
-
border-top-color: #DADADA;
|
51
|
-
color: #666;
|
52
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
-
}
|
54
|
-
</style>
|
55
|
-
</head>
|
56
|
-
|
57
|
-
<body class="rails-default-error-page">
|
58
|
-
<!-- This file lives in public/422.html -->
|
59
|
-
<div class="dialog">
|
60
|
-
<div>
|
61
|
-
<h1>The change you wanted was rejected.</h1>
|
62
|
-
<p>Maybe you tried to change something you didn't have access to.</p>
|
63
|
-
</div>
|
64
|
-
<p>If you are the application owner check the logs for more information.</p>
|
65
|
-
</div>
|
66
|
-
</body>
|
67
|
-
</html>
|
data/public/500.html
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>We're sorry, but something went wrong (500)</title>
|
5
|
-
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
-
<style>
|
7
|
-
.rails-default-error-page {
|
8
|
-
background-color: #EFEFEF;
|
9
|
-
color: #2E2F30;
|
10
|
-
text-align: center;
|
11
|
-
font-family: arial, sans-serif;
|
12
|
-
margin: 0;
|
13
|
-
}
|
14
|
-
|
15
|
-
.rails-default-error-page div.dialog {
|
16
|
-
width: 95%;
|
17
|
-
max-width: 33em;
|
18
|
-
margin: 4em auto 0;
|
19
|
-
}
|
20
|
-
|
21
|
-
.rails-default-error-page div.dialog > div {
|
22
|
-
border: 1px solid #CCC;
|
23
|
-
border-right-color: #999;
|
24
|
-
border-left-color: #999;
|
25
|
-
border-bottom-color: #BBB;
|
26
|
-
border-top: #B00100 solid 4px;
|
27
|
-
border-top-left-radius: 9px;
|
28
|
-
border-top-right-radius: 9px;
|
29
|
-
background-color: white;
|
30
|
-
padding: 7px 12% 0;
|
31
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
-
}
|
33
|
-
|
34
|
-
.rails-default-error-page h1 {
|
35
|
-
font-size: 100%;
|
36
|
-
color: #730E15;
|
37
|
-
line-height: 1.5em;
|
38
|
-
}
|
39
|
-
|
40
|
-
.rails-default-error-page div.dialog > p {
|
41
|
-
margin: 0 0 1em;
|
42
|
-
padding: 1em;
|
43
|
-
background-color: #F7F7F7;
|
44
|
-
border: 1px solid #CCC;
|
45
|
-
border-right-color: #999;
|
46
|
-
border-left-color: #999;
|
47
|
-
border-bottom-color: #999;
|
48
|
-
border-bottom-left-radius: 4px;
|
49
|
-
border-bottom-right-radius: 4px;
|
50
|
-
border-top-color: #DADADA;
|
51
|
-
color: #666;
|
52
|
-
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
-
}
|
54
|
-
</style>
|
55
|
-
</head>
|
56
|
-
|
57
|
-
<body class="rails-default-error-page">
|
58
|
-
<!-- This file lives in public/500.html -->
|
59
|
-
<div class="dialog">
|
60
|
-
<div>
|
61
|
-
<h1>We're sorry, but something went wrong.</h1>
|
62
|
-
</div>
|
63
|
-
<p>If you are the application owner check the logs for more information.</p>
|
64
|
-
</div>
|
65
|
-
</body>
|
66
|
-
</html>
|
File without changes
|
data/public/apple-touch-icon.png
DELETED
File without changes
|
data/public/favicon.ico
DELETED
File without changes
|
data/public/robots.txt
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
|
data/test/controllers/.keep
DELETED
File without changes
|
data/test/fixtures/.keep
DELETED
File without changes
|
data/test/fixtures/brands.yml
DELETED
data/test/fixtures/files/.keep
DELETED
File without changes
|
data/test/fixtures/users.yml
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
2
|
-
|
3
|
-
# This model initially had no columns defined. If you add columns to the
|
4
|
-
# model remove the '{}' from the fixture names and add the columns immediately
|
5
|
-
# below each fixture, per the syntax in the comments below
|
6
|
-
#
|
7
|
-
one: {}
|
8
|
-
# column: value
|
9
|
-
#
|
10
|
-
two: {}
|
11
|
-
# column: value
|
data/test/fixtures/variants.yml
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
2
|
-
|
3
|
-
one:
|
4
|
-
name: MyString
|
5
|
-
enginecap: 1
|
6
|
-
year: 1
|
7
|
-
fueltype: MyString
|
8
|
-
gearshift: MyString
|
9
|
-
fuelcap: 1
|
10
|
-
seating: 1
|
11
|
-
mileage: 1.5
|
12
|
-
price: 1.5
|
13
|
-
|
14
|
-
two:
|
15
|
-
name: MyString
|
16
|
-
enginecap: 1
|
17
|
-
year: 1
|
18
|
-
fueltype: MyString
|
19
|
-
gearshift: MyString
|
20
|
-
fuelcap: 1
|
21
|
-
seating: 1
|
22
|
-
mileage: 1.5
|
23
|
-
price: 1.5
|
data/test/helpers/.keep
DELETED
File without changes
|
data/test/integration/.keep
DELETED
File without changes
|
data/test/mailers/.keep
DELETED
File without changes
|
data/test/models/.keep
DELETED
File without changes
|
data/test/models/brand_test.rb
DELETED
data/test/models/user_test.rb
DELETED