Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Final #17

Open
wants to merge 84 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
025b473
Add gems for test and linters error
vic778 May 13, 2022
12ba5f2
Add factory
vic778 May 13, 2022
8290d34
Add cros to give access to anyone
vic778 May 13, 2022
978a872
Create user controler with the action for creating a user and update
vic778 May 13, 2022
e93f4be
Add the path route
vic778 May 13, 2022
d37e0d4
Create the Api folder that contains the modul for user
vic778 May 13, 2022
1d9aea7
Add the validations presence and add digest to make the password hash…
vic778 May 13, 2022
f4fc926
Migrate the user table
vic778 May 13, 2022
455b39e
Create foctory to test the user
vic778 May 13, 2022
7f44c03
Add ruboccop
vic778 May 13, 2022
49b059c
Fix linter errors
vic778 May 13, 2022
0b48868
Permit the parms
vic778 May 13, 2022
567cb7d
Add route for update and delete
vic778 May 13, 2022
4f3b0a2
Merge pull request #8 from vic778/register
vic778 May 13, 2022
e9a413f
Add login method
cwaku May 13, 2022
263bc74
Add route to login
cwaku May 13, 2022
b3468c3
Change route for login
cwaku May 13, 2022
3a3e65e
Fix Linter errors
cwaku May 13, 2022
6657a5e
Merge pull request #9 from vic778/auth
cwaku May 13, 2022
5aed8dd
Add test for model and config factorr
vic778 May 13, 2022
bf7138a
Fix linter error
vic778 May 13, 2022
c04c662
Test api login
cwaku May 13, 2022
8499eb9
Test user request
vic778 May 14, 2022
c826e03
Test user_spec
vic778 May 14, 2022
206d9d5
Fix linters error
vic778 May 14, 2022
7822b82
Test login via api
cwaku May 14, 2022
75eea23
Change status cose to accepted in authentication spec
cwaku May 14, 2022
c96a1e9
Test login error
cwaku May 14, 2022
2fe497d
Test to ensure login returns token and user
cwaku May 14, 2022
e60e2d0
Test to ensure login returns correct user
cwaku May 14, 2022
8b7289b
Fix linter error
cwaku May 14, 2022
9c6157e
Merge pull request #10 from vic778/test
vic778 May 15, 2022
1c7c471
Remove the question mark i=for the authorize action
vic778 May 15, 2022
f6f84ab
Add the validations
vic778 May 15, 2022
b8b0b48
Create the route for motorcyles
vic778 May 15, 2022
5ffb93f
Add year color and model to motorcyles tables
vic778 May 15, 2022
ae06fbc
Add the association
vic778 May 15, 2022
c7b176a
Create the test for motorcyles
vic778 May 15, 2022
7986e34
Create the migration
vic778 May 15, 2022
71ed7e1
fix linter
vic778 May 15, 2022
3612aa1
Add carriewave for image
vic778 May 16, 2022
5f88b18
Added mount_uploader
vic778 May 16, 2022
585560b
Store image into the Db
vic778 May 16, 2022
05d2515
Fix linter error
vic778 May 16, 2022
cafae17
Create controller for reservations
cwaku May 17, 2022
3342e76
Update motorcycles with availability and finish controller methods
cwaku May 17, 2022
1978f3a
Add routes for reservation
cwaku May 17, 2022
4aa2d08
Merge pull request #11 from vic778/motorycle
vic778 May 17, 2022
9d9927f
Add serilazer
vic778 May 17, 2022
d874834
Fix linter errors
cwaku May 17, 2022
5a05366
Fix linter errors
cwaku May 17, 2022
dc58bcf
Merge pull request #12 from vic778/reservations
vic778 May 18, 2022
1d2035f
Describe the project
vic778 May 18, 2022
407cc0a
Update README with description and author details
cwaku May 18, 2022
e0da7c2
Merge pull request #13 from vic778/final
cwaku May 18, 2022
7860d12
Added carrierWave to production
cwaku May 18, 2022
9825f57
Add deployment
cwaku May 18, 2022
0265630
Add heroku link
vic778 May 18, 2022
4c5d46b
Serialize image color model and year
vic778 May 23, 2022
150a017
Update resevation with date and city
cwaku May 23, 2022
0237e67
Update schema
cwaku May 23, 2022
51b2a30
test api
cwaku May 23, 2022
6f540d0
Update API base url
cwaku May 23, 2022
d655a58
[ImgBot] Optimize images
ImgBotApp May 23, 2022
75548de
Fix linter errors
cwaku May 23, 2022
840e340
Merge pull request #15 from vic778/imgbot
cwaku May 23, 2022
df272cb
remove authorization for bike show
cwaku May 25, 2022
77ec593
Validate
vic778 May 26, 2022
29a796d
Remove update availble in the controller
vic778 May 27, 2022
aafc8a0
Add update after canclel the reservation
vic778 May 27, 2022
42f48b8
Add dependes destroy for a reservation
vic778 May 27, 2022
3259347
Update available byr false after reserving a bik
vic778 May 27, 2022
9e021c4
Add dependes destory to delete even the bike when the user is deleted
vic778 May 27, 2022
4ce51ad
Update the schema
vic778 May 27, 2022
023c6e9
Remove comment lines
vic778 May 27, 2022
259b1e1
Fix linter error
vic778 May 27, 2022
8d1db46
Update route names
cwaku May 27, 2022
894046f
Add set reservation to create method
cwaku May 27, 2022
b362c6e
Add set scooter to create method
cwaku May 27, 2022
8c59c77
Remove set scooter to create method
cwaku May 27, 2022
b089dba
reset database
cwaku May 27, 2022
e12fd65
reset database
cwaku May 27, 2022
14c6b90
Check the Id before action (#18)
vic778 Jun 7, 2022
458eceb
Change request (#19)
vic778 Jun 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# See https://git-scm.com/docs/gitattributes for more about git attribute files.

# Mark the database schema as having been generated.
db/schema.rb linguist-generated

# Mark any vendored files as having been vendored.
vendor/* linguist-vendored
23 changes: 23 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Linters

on: pull_request

env:
FORCE_COLOR: 1

jobs:
rubocop:
name: Rubocop
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-ruby@v1
with:
ruby-version: 3.0.x
- name: Setup Rubocop
run: |
gem install --no-document rubocop -v '>= 1.0, < 2.0' # https://docs.rubocop.org/en/stable/installation/
[ -f .rubocop.yml ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/ror/.rubocop.yml
- name: Rubocop Report
run: rubocop --color

29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

# Ignore bundler config.
/.bundle

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/
!/tmp/pids/.keep

# Ignore uploaded files in development.
/storage/*
!/storage/.keep
/tmp/storage/*
!/tmp/storage/
!/tmp/storage/.keep

# Ignore master key for decrypting credentials and more.
/config/master.key
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--require spec_helper
73 changes: 73 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
AllCops:
NewCops: enable
Exclude:
- "db/**/*"
- "bin/*"
- "config/**/*"
- "Guardfile"
- "Rakefile"
- "node_modules/**/*"

DisplayCopNames: true

Layout/LineLength:
Max: 120
Metrics/MethodLength:
Include:
- "app/controllers/*"
- "app/models/*"
Max: 20
Metrics/AbcSize:
Include:
- "app/controllers/*"
- "app/models/*"
Max: 50
Metrics/ClassLength:
Max: 150
Metrics/BlockLength:
IgnoredMethods: ['describe']
Max: 30

Style/Documentation:
Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
Style/EachForSimpleLoop:
Enabled: false
Style/AndOr:
Enabled: false
Style/DefWithParentheses:
Enabled: false
Style/FrozenStringLiteralComment:
EnforcedStyle: never
Style/StringLiterals:
Enabled: false
Style/GuardClause:
Enabled: false
Style/RedundantArgument:
Enabled: false
Lint/UselessAssignment:
Enabled: false
Lint/RedundantDirGlobSort:
Enabled: false


Layout/HashAlignment:
EnforcedColonStyle: key
Layout/ExtraSpacing:
AllowForAlignment: false
Layout/MultilineMethodCallIndentation:
Enabled: true
EnforcedStyle: indented
Lint/RaiseException:
Enabled: false
Lint/StructNewOverride:
Enabled: false
Lint/MissingCopEnableDirective:
Enabled: false
Style/HashEachMethods:
Enabled: false
Style/HashTransformKeys:
Enabled: false
Style/HashTransformValues:
Enabled: false
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0.2
28 changes: 18 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby "3.0.2"
ruby '3.0.2'

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.0.3"
gem 'rails', '~> 7.0.3'

# Use postgresql as the database for Active Record
gem "pg", "~> 1.1"
gem 'pg', '~> 1.1'

# Use the Puma web server [https://github.com/puma/puma]
gem "puma", "~> 5.0"
gem 'puma', '~> 5.0'

# Build JSON APIs with ease [https://github.com/rails/jbuilder]
# gem "jbuilder"
gem 'active_model_serializers', '~> 0.10.0'

# Use Redis adapter to run Action Cable in production
# gem "redis", "~> 4.0"
Expand All @@ -22,27 +23,34 @@ gem "puma", "~> 5.0"
# gem "kredis"

# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
# gem "bcrypt", "~> 3.1.7"
gem 'bcrypt', '~> 3.1.7'
gem 'jwt'

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]

# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false
gem 'bootsnap', require: false

# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"

# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
# gem "rack-cors"
gem 'rack-cors'

gem 'carrierwave'

group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", platforms: %i[ mri mingw x64_mingw ]
gem 'debug', platforms: %i[mri mingw x64_mingw]
gem 'factory_bot_rails'
gem 'faker'
gem 'rspec-rails'
gem 'rubocop'
gem 'rubocop-rspec'
end

group :development do
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
# gem "spring"
end

88 changes: 88 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ GEM
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_model_serializers (0.10.13)
actionpack (>= 4.1, < 7.1)
activemodel (>= 4.1, < 7.1)
case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
activejob (7.0.3)
activesupport (= 7.0.3)
globalid (>= 0.3.6)
Expand All @@ -66,30 +71,59 @@ GEM
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
ast (2.4.2)
bcrypt (3.1.17)
bootsnap (1.11.1)
msgpack (~> 1.2)
builder (3.2.4)
carrierwave (2.2.2)
activemodel (>= 5.0.0)
activesupport (>= 5.0.0)
addressable (~> 2.6)
image_processing (~> 1.1)
marcel (~> 1.0.0)
mini_mime (>= 0.1.3)
ssrf_filter (~> 1.0)
case_transform (0.2)
activesupport
concurrent-ruby (1.1.10)
crass (1.0.6)
debug (1.5.0)
irb (>= 1.3.6)
reline (>= 0.2.7)
diff-lcs (1.5.0)
digest (3.1.0)
erubi (1.10.0)
factory_bot (6.2.1)
activesupport (>= 5.0.0)
factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0)
railties (>= 5.0.0)
faker (2.20.0)
i18n (>= 1.8.11, < 2)
ffi (1.15.5)
globalid (1.0.0)
activesupport (>= 5.0)
i18n (1.10.0)
concurrent-ruby (~> 1.0)
image_processing (1.12.2)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3)
io-console (0.5.11)
irb (1.4.1)
reline (>= 0.3.0)
jsonapi-renderer (0.2.2)
jwt (2.3.0)
loofah (2.18.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (1.0.2)
method_source (1.0.0)
mini_magick (4.11.0)
mini_mime (1.1.2)
minitest (5.15.0)
msgpack (1.5.1)
Expand All @@ -110,11 +144,17 @@ GEM
nio4r (2.5.8)
nokogiri (1.13.6-x86_64-linux)
racc (~> 1.4)
parallel (1.22.1)
parser (3.1.2.0)
ast (~> 2.4.1)
pg (1.3.5)
public_suffix (4.0.7)
puma (5.6.4)
nio4r (~> 2.0)
racc (1.6.0)
rack (2.2.3)
rack-cors (1.1.1)
rack (>= 2.0.0)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (7.0.3)
Expand Down Expand Up @@ -143,14 +183,52 @@ GEM
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.4.0)
reline (0.3.1)
io-console (~> 0.5)
rexml (3.2.5)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-mocks (3.11.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-rails (5.1.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
railties (>= 5.2)
rspec-core (~> 3.10)
rspec-expectations (~> 3.10)
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.11.0)
rubocop (1.29.1)
parallel (~> 1.10)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.17.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.17.0)
parser (>= 3.1.1.0)
rubocop-rspec (2.10.0)
rubocop (~> 1.19)
ruby-progressbar (1.11.0)
ruby-vips (2.1.4)
ffi (~> 1.12)
ssrf_filter (1.0.7)
strscan (3.0.3)
thor (1.2.1)
timeout (0.2.0)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
unicode-display_width (2.1.0)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand All @@ -160,11 +238,21 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
active_model_serializers (~> 0.10.0)
bcrypt (~> 3.1.7)
bootsnap
carrierwave
debug
factory_bot_rails
faker
jwt
pg (~> 1.1)
puma (~> 5.0)
rack-cors
rails (~> 7.0.3)
rspec-rails
rubocop
rubocop-rspec
tzinfo-data

RUBY VERSION
Expand Down
Loading