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

Pablo Joyce chitter challenge #2174

Open
wants to merge 80 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
5ccef5b
chitter plan setup
pablisch Apr 6, 2023
9956e10
limited project setup
pablisch Apr 6, 2023
04ddf5e
Project files setup. Rackup error.
pablisch Apr 7, 2023
e4c30e0
app.rb not seeing peep methods. RSpec tests ok
pablisch Apr 7, 2023
a9307db
all tests pass. peep & user #s not seen by app.rb
pablisch Apr 7, 2023
fb90cd7
setup pages. peep/user #s working. tests pass
pablisch Apr 8, 2023
f9417d0
create peep part coded. Test passing
pablisch Apr 8, 2023
6a3a0e4
Added hidden input to add_peep.erb for user_id val
pablisch Apr 9, 2023
60390cf
Working again after anomalous errors
pablisch Apr 9, 2023
5821da3
basic register process working and tested
pablisch Apr 9, 2023
5f73b84
Part way through vaildation. tests passing.
pablisch Apr 10, 2023
3ff7f2b
pablisch Apr 10, 2023
964a449
Valdiation complete except unique
pablisch Apr 10, 2023
8eda5ca
unique email and username validation and tests
pablisch Apr 10, 2023
cca3382
installed bcrypt
pablisch Apr 10, 2023
4d53c3e
Added bcrypt code that has broken tests
pablisch Apr 10, 2023
1144a1a
Edited PWs in seeds tables to hashes. Tests good
pablisch Apr 10, 2023
2897786
reverse bcrypt. some css.
pablisch Apr 10, 2023
5f5a03e
Some small css and index.erb changes
pablisch Apr 11, 2023
0a2a574
Fixed issue of wrong db being used
pablisch Apr 11, 2023
fa32980
seeds edit and about to start bcrypt again
pablisch Apr 11, 2023
45dd4d3
bcrypt implemented and working
pablisch Apr 11, 2023
44653c7
Merge pull request #1 from pablisch/bcrypt
pablisch Apr 11, 2023
11fb2be
mostly css changes and erb page layout
pablisch Apr 11, 2023
7e3e7f6
Playing around with time format
pablisch Apr 11, 2023
8f77719
css almost done. tests passing
pablisch Apr 11, 2023
378b67a
updated tables
pablisch Apr 11, 2023
87684c9
setup for deploy
pablisch Apr 11, 2023
9ea5c6f
updated database_connect for Render
pablisch Apr 11, 2023
28e1758
commented out all uses of logged var
pablisch Apr 11, 2023
0047743
deploy unsuccessful. changes reversed.
pablisch Apr 11, 2023
c8da0b6
images moved
pablisch Apr 12, 2023
dd80942
shortened route paths. Tests all working
pablisch Apr 13, 2023
98178ce
edit logged to session user_id
pablisch Apr 13, 2023
195030b
commented out all instances of settings.logged
pablisch Apr 13, 2023
ad1e613
Database connection set to deploy
pablisch Apr 13, 2023
dbf2c85
remove p test from peep repo rb
pablisch Apr 13, 2023
6e16997
Removed all logged mentions from app.rb
pablisch Apr 13, 2023
316a1f1
Removed logged from add peep erb
pablisch Apr 13, 2023
cc3669b
Removed last 'logged' from index erb
pablisch Apr 13, 2023
54e41ec
indent changes in index.erb
pablisch Apr 13, 2023
0fd6fe2
conditional correction in index.rb
pablisch Apr 13, 2023
a45ff71
Removed settings.logged from register & login erb
pablisch Apr 13, 2023
77e969b
replaced Sinatra validation var for session var
pablisch Apr 13, 2023
251ad3d
Edit database connection for deploy
pablisch Apr 13, 2023
0cb10f7
Disposed of settings.message. The last Sinatra var
pablisch Apr 13, 2023
b64a3e9
css styling for buttons and input fields
pablisch Apr 13, 2023
4d5e967
Added padding to below error messages
pablisch Apr 13, 2023
2f4c3ce
extra padding for header elements
pablisch Apr 13, 2023
94a3411
15px padding below panel p
pablisch Apr 13, 2023
b9954d3
panel p margin 10px
pablisch Apr 13, 2023
53625b8
text box margins
pablisch Apr 14, 2023
da5e800
extra margin bottom for text boxes
pablisch Apr 14, 2023
8d7e703
margin left for text boxes
pablisch Apr 14, 2023
e2337b2
correct margin for new peep page
pablisch Apr 14, 2023
c69b125
adjustment to new peep page margins
pablisch Apr 14, 2023
ec5acbe
Added hover colour for nav links
pablisch Apr 14, 2023
4b4646f
button hover colour change
pablisch Apr 14, 2023
4a4c1be
nav h1 hover white
pablisch Apr 14, 2023
a58df1d
DB connection set for local view
pablisch Apr 14, 2023
5f57bdf
small css edits to nav
pablisch Apr 14, 2023
3586557
db connect to deploy
pablisch Apr 14, 2023
94a0c34
text input field alignment
pablisch Apr 14, 2023
853d26f
Comment out render deploy database connect code
pablisch Apr 19, 2023
73f3ef2
Fixed test and edits to README
pablisch Jun 23, 2023
cbe4f45
More README and chitter_plan updates
pablisch Jun 23, 2023
53e9a3f
Final, for now, README edit
pablisch Jun 23, 2023
3f71018
main README edit
pablisch Jun 23, 2023
b0e66c1
Merge branch 'main' into local-server
pablisch Jun 23, 2023
975a2d7
Merge pull request #2 from pablisch/local-server
pablisch Jun 23, 2023
6fde111
Added links and two images to readme
pablisch Jun 27, 2023
d054c50
Added images for test and coverage
pablisch Jun 27, 2023
8bad1fb
Format test
pablisch Jun 27, 2023
66ce8d4
Format test
pablisch Jun 27, 2023
b93f21f
Format test
pablisch Jun 27, 2023
948055e
Format test
pablisch Jun 27, 2023
755b40a
Format test
pablisch Jun 27, 2023
55f9ca9
Added tech symbols
pablisch Jun 27, 2023
212c657
Changed user emails and passwords
pablisch Jul 15, 2023
eb65387
Updated tables and seeds
pablisch Jul 15, 2023
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
Prev Previous commit
Next Next commit
Added bcrypt code that has broken tests
pablisch committed Apr 10, 2023
commit 4d53c3ea9406fc3ffe93047ef8beb93ac18a8413
2 changes: 0 additions & 2 deletions app.rb
Original file line number Diff line number Diff line change
@@ -3,8 +3,6 @@
require 'sinatra/reloader'
require_relative 'lib/user_repository'
require_relative 'lib/peep_repository'
require 'bcrypt'
# require '~/projects/makers/web-applications/chitter/lib/peep_repository'

DatabaseConnection.connect('chitter_test')

5 changes: 3 additions & 2 deletions lib/user_repository.rb

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean and readable CRUD methods

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require_relative './user'
require 'bcrypt'

class UserRepository
def all
@@ -11,7 +12,7 @@ def all

def create(user)
sql = 'INSERT INTO users (name, username, email, password) VALUES ($1, $2, $3, $4);'
params = [user.name, user.username, user.email, user.password]
params = [user.name, user.username, user.email, BCrypt::Password.create(user.password)]
DatabaseConnection.exec_params(sql, params)
end

@@ -48,7 +49,7 @@ def user_builder(record)
user.name = record['name']
user.username = record['username']
user.email = record['email']
user.password = record['password']
user.password = BCrypt::Password.new(record['password'])
return user
end