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

API v1 #11

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
96b2403
Add slack notifications for travis
naoisegolden Feb 7, 2015
3d91ea6
Test after making repo private
naoisegolden Feb 8, 2015
a614900
Test after making repo public again
naoisegolden Feb 8, 2015
67ebb3b
[add] gems for development
ssuprunenko Feb 9, 2015
b123291
[add] Pagination
ssuprunenko Feb 9, 2015
82449a0
[add] Serializer for Users
ssuprunenko Feb 9, 2015
7fef148
[add] Usefull rake task 'rake color_routes'
ssuprunenko Feb 9, 2015
ee20a68
[add] 404 handling for users#show
ssuprunenko Feb 9, 2015
6c3a527
[add] Simple CRUD for Users
ssuprunenko Feb 9, 2015
140ee19
[feature] API authentication by access token
ssuprunenko Feb 9, 2015
73e194c
[feature] Auth action
ssuprunenko Feb 10, 2015
5296405
[add] CRUD for Divesites
ssuprunenko Feb 10, 2015
8341c6a
[add] CRUD for Dives
ssuprunenko Feb 10, 2015
e8974e8
[add] Divesites by User
ssuprunenko Feb 10, 2015
0f2c8cd
[add] Users by Dive Site
ssuprunenko Feb 10, 2015
de2b6cf
[add] Dives by Dive Site and by User
ssuprunenko Feb 10, 2015
270a10d
[add test] Users#show
ssuprunenko Feb 11, 2015
357d6ee
[feature] Return 201 Created after successful #create request
ssuprunenko Feb 11, 2015
e9d8689
[add test] Users#update
ssuprunenko Feb 11, 2015
247c48d
[add test] Users#destroy
ssuprunenko Feb 11, 2015
0dbf353
[add tests] Users#index and Users#auth
ssuprunenko Feb 11, 2015
77b64fa
[add tests] For DivesitesController
ssuprunenko Feb 11, 2015
5619008
[add tests] For DivesController
ssuprunenko Feb 11, 2015
8782d2b
[add] Gems for production
ssuprunenko Feb 11, 2015
2d47494
Prepare for deployment
ssuprunenko Feb 11, 2015
2f1a662
[add] Dives attribute to JSON for Dive Sites
ssuprunenko Feb 11, 2015
294ba70
[add] Image model
ssuprunenko Feb 12, 2015
0fced9c
[add] Images controller
ssuprunenko Feb 12, 2015
642b6e9
[feature] Upload images to Amazon S3
ssuprunenko Feb 12, 2015
b6378ca
[add] Images#create
ssuprunenko Feb 12, 2015
f9f113f
[add] Divesite id and User id to Image JSON
ssuprunenko Feb 12, 2015
e4e1ebe
[add] API Documentation
ssuprunenko Feb 12, 2015
29b3397
[add] Connection through HTTPS
ssuprunenko Feb 13, 2015
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
[add] Pagination
ssuprunenko committed Feb 9, 2015
commit b123291767558042716d90e099b10dadfcff742e
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -22,6 +22,11 @@ gem 'newrelic_rpm'

# ENV variables
gem 'dotenv-deployment'
gem 'faker', '~> 1.4'

# API
gem 'kaminari'
gem 'api-pagination'

#assets
gem 'uglifier', '>= 2.7.0'
9 changes: 9 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -49,6 +49,7 @@ GEM
annotate (2.6.5)
activerecord (>= 2.3.0)
rake (>= 0.8.7)
api-pagination (4.1.0)
arel (6.0.0)
awesome_print (1.6.1)
bcrypt (3.1.10)
@@ -92,6 +93,8 @@ GEM
dotenv (~> 1.0)
erubis (2.7.0)
execjs (2.3.0)
faker (1.4.3)
i18n (~> 0.5)
faraday (0.9.1)
multipart-post (>= 1.2, < 3)
fssm (0.2.10)
@@ -107,6 +110,9 @@ GEM
i18n (0.7.0)
json (1.8.2)
jwt (1.2.1)
kaminari (0.16.2)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
launchy (2.4.3)
addressable (~> 2.3)
letter_opener (1.3.0)
@@ -244,6 +250,7 @@ PLATFORMS

DEPENDENCIES
annotate
api-pagination
awesome_print
better_errors
binding_of_caller
@@ -253,9 +260,11 @@ DEPENDENCIES
country_select
devise (~> 3.4.1)
dotenv-deployment
faker (~> 1.4)
foundation-icons-sass-rails!
geocoder
hirb-unicode
kaminari
letter_opener
meta_request (~> 0.3)
modular-scale (= 1.0.2)
7 changes: 7 additions & 0 deletions app/controllers/api/v1/users_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Api::V1::UsersController < ApplicationController
def index
users = paginate User.all

render json: users
end
end
5 changes: 5 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Divebook::Application.routes.draw do
namespace :api do
namespace :v1 do
resources :users
end
end

#Locations
resources :locations
17 changes: 10 additions & 7 deletions db/seeds.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel', city: cities.first)
count = 0
15.times do
User.create(
name: Faker::Name.name,
email: "user#{count}@example.com",
password: '12345678',
country: Faker::Address.country)

count += 1
end