Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added .DS_Store
Binary file not shown.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### v0.1.0
* Integrate rspec
* Add rake db:reset task
* Upgrade rake to 10.1.0
* Upgrade sinatra to 1.4.3
* Upgrade sinatra-contrib to 1.4.1

### v.0.1.1
* Implement a basic class and spec to exercise it
* Relocate misplaced comma set
* Convert models/README to Markdown
* Correct misusue of e.g.
* Convert helpers/README to Markdown
* Implement a "em" helper for reference; improve README
35 changes: 35 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
source 'https://rubygems.org'
ruby '2.0.0'

# PostgreSQL driver
gem 'pg'

# Sinatra driver
gem 'sinatra'
gem 'sinatra-contrib'

gem 'activesupport', '~>4.1'
gem 'activerecord', '~>4.1'

gem 'rake'

gem 'thin'

gem 'bcrypt'

gem 'gravatarify', '~> 3.0.0'

group :test do
gem 'shoulda-matchers'
gem 'rack-test'
gem 'rspec'
gem 'capybara'
gem 'faker'
end

group :test, :development do
gem 'rerun'
gem 'shotgun'
gem 'factory_girl'
gem 'sinatra-partial'
end
127 changes: 127 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
GEM
remote: https://rubygems.org/
specs:
activemodel (4.2.0)
activesupport (= 4.2.0)
builder (~> 3.1)
activerecord (4.2.0)
activemodel (= 4.2.0)
activesupport (= 4.2.0)
arel (~> 6.0)
activesupport (4.2.0)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
arel (6.0.0)
backports (3.6.4)
bcrypt (3.1.10)
builder (3.2.2)
capybara (2.4.4)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
celluloid (0.16.0)
timers (~> 4.0.0)
daemons (1.1.9)
diff-lcs (1.2.5)
eventmachine (1.0.6)
factory_girl (4.5.0)
activesupport (>= 3.0.0)
faker (1.4.3)
i18n (~> 0.5)
ffi (1.9.6)
gravatarify (3.0.0)
hitimes (1.2.2)
i18n (0.7.0)
json (1.8.2)
listen (2.8.5)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
mime-types (2.4.3)
mini_portile (0.6.2)
minitest (5.5.1)
multi_json (1.10.1)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
pg (0.18.1)
rack (1.6.0)
rack-protection (1.5.3)
rack
rack-test (0.6.3)
rack (>= 1.0)
rake (10.4.2)
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rerun (0.10.0)
listen (~> 2.7, >= 2.7.3)
rspec (3.2.0)
rspec-core (~> 3.2.0)
rspec-expectations (~> 3.2.0)
rspec-mocks (~> 3.2.0)
rspec-core (3.2.0)
rspec-support (~> 3.2.0)
rspec-expectations (3.2.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.2.0)
rspec-mocks (3.2.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.2.0)
rspec-support (3.2.1)
shotgun (0.9)
rack (>= 1.0)
shoulda-matchers (2.8.0)
activesupport (>= 3.0.0)
sinatra (1.4.5)
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (~> 1.3, >= 1.3.4)
sinatra-contrib (1.4.2)
backports (>= 2.0)
multi_json
rack-protection
rack-test
sinatra (~> 1.4.0)
tilt (~> 1.3)
sinatra-partial (0.4.0)
sinatra
thin (1.6.3)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0)
rack (~> 1.0)
thread_safe (0.3.4)
tilt (1.4.1)
timers (4.0.1)
hitimes
tzinfo (1.2.2)
thread_safe (~> 0.1)
xpath (2.0.0)
nokogiri (~> 1.3)

PLATFORMS
ruby

DEPENDENCIES
activerecord (~> 4.1)
activesupport (~> 4.1)
bcrypt
capybara
factory_girl
faker
gravatarify (~> 3.0.0)
pg
rack-test
rake
rerun
rspec
shotgun
shoulda-matchers
sinatra
sinatra-contrib
sinatra-partial
thin
118 changes: 118 additions & 0 deletions Planning - Schema, Models, and Features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Schema

#### Shoes
* brand
* model
* price
* size

#### review
* author_id (user_id)
* votes_up
* comment_body
* authors_fit_opinion (it fits their foot well or not)

#### Users
* foot_profile
* (optional)foot_mature?

#### Foot_profiles
* size

#### Votes
* vote_count

# Models
#### Votes
* uniqueness scope (AR), combination of voter_id & comment_id must be unique


#### User
* has_many :review
* belongs_to :foot_profile
* Method to: View all review made by user, linked by shoe image (active record scopes)
* Method to: View total votes up/down

#### Foot_profile
* has_many :users

####Shoe
* has many :review
* composite attribute for shoe image based on brand and model naming convention

#### review
* shoe_id
* author_id
* message




#Features
* Can view all review for all sizes pertaining to a specifc shoe in character-limited divs.
* Can expand all review on a page with one button.
* Can view all review made by a user




#Milestones
####Requirements
* Portfolio 1: Sinatra RESTful CRUD
* Portfolio 2: Active Record
* Portfolio 3: Authentication And Authorization
* Portfolio 4: HTML and CSS
* Portfolio 5: Validations and Errors

####User Stories
* A rock climber can view the site without registering or logging in.
* A rock climber can register for an account and login to leave reviews and vote(?).
* A rock climber can search for shoes.
* A rock climber can read other rock climbers' opinions or reviews of a specific size of a specific model of a shoe.
* A rock climber can leave a review.
* A rock climber must say whether a shoe fits the shape of their particular foot as part of their review.
* A rock climber can add a picture to their review.
* A rock climber can vote on whether another climber's review is helpful. (?)
* A rock climber can see a list of the reviews authored by another rock climber.
* A rock climber can define the profile of their foot, either empirically or with measurements.
* A rock climber can get the profile of their foot by taking specific measurements.
* A rock climber can verify the validity of their measurements by taking a picture of their foot from a specific angle with some reference.
* A rock climber can sort shoes based on the reviews left by rock climbers with similarly shaped feet.
* A rock climber can see a list of prices from different retailers for each shoe.


####Deliverables
* Readme.md with running instructions
* **Passion Project A Features & Requirements Chart:**

| Feature | P1 | P2 | P3 | P4 | P5 |
| ------- | --- | --- | --- | --- | --- |
| | | | | | |




to-do:
2.8
add "review written XXX ago" counter
add error handling & validations
add pictures

2.5
Test connections with fake seeds in db
Search: ilike(any(array)) (?syntax)

where(product ilike ANY([? ARRAY]))
<!-- Angela & Bryan code below: -->
class Question < Posting
has_many :answers


def self.search(string)
Question.where("content ILIKE ANY ( array[?] ) OR title ILIKE ANY ( array[?] )", parsed(string), parsed(string))
end

def self.parsed(string)
string.tr('^A-Za-z0-9 ', '').split(' ').map {|val| "%#{val}%" }
end
end
Loading