trogdir_api 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config.ru +8 -2
- data/lib/trogdir/versions/v1/api.rb +4 -1
- data/lib/trogdir/versions/v1/entities/person.rb +2 -0
- data/lib/trogdir/versions/v1/entities/sync_log_with_changeset.rb +2 -0
- data/lib/trogdir/versions/v1/people_api.rb +4 -0
- data/lib/trogdir_api.rb +1 -0
- data/lib/trogdir_api/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5eae02ebddb3a522c550819032628f91da2ec72
|
4
|
+
data.tar.gz: 45d616eaa836d702cdd1e87a1811134da5e33aff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 365e67b6dda2b2a5512f2c764ebd05c48b03902a10be9bd47a7c662f6e823260e9fdfc47e481a650b461050dd92742834f489a28171a9bbf167d804939b228bd
|
7
|
+
data.tar.gz: 9213a1271531df3af42aa4d27428aeed37ab832f1541b75494ec46332842c63840d247fc6accfa23aa7a5cfbdaf89a61fa1f900dcfd34197f9f15a5f97b243a7
|
data/config.ru
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require ::File.expand_path('../config/environment', __FILE__)
|
2
2
|
|
3
|
-
|
3
|
+
env = ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'development'
|
4
|
+
|
5
|
+
if env == 'development'
|
4
6
|
require 'newrelic_rpm'
|
5
7
|
require 'new_relic/rack/developer_mode'
|
6
8
|
use NewRelic::Rack::DeveloperMode
|
@@ -9,6 +11,10 @@ if ENV['RACK_ENV'] == 'development'
|
|
9
11
|
use BetterErrors::Middleware
|
10
12
|
end
|
11
13
|
|
14
|
+
file = File.new("./log/#{env}.log", 'a+')
|
15
|
+
file.sync = true
|
16
|
+
use Rack::CommonLogger, file
|
17
|
+
|
12
18
|
use Pinglish, &TrogdirAPI.pinglish_block
|
13
19
|
|
14
|
-
run Trogdir::API
|
20
|
+
run Trogdir::API
|
@@ -8,7 +8,10 @@ module Trogdir
|
|
8
8
|
helpers RequestHelpers
|
9
9
|
helpers AuthenticationHelpers
|
10
10
|
|
11
|
-
before
|
11
|
+
before do
|
12
|
+
authenticate!
|
13
|
+
Syncinator.current = current_syncinator
|
14
|
+
end
|
12
15
|
|
13
16
|
rescue_from Mongoid::Errors::DocumentNotFound do |e|
|
14
17
|
Rack::Response.new([{error: '404 Not Found'}.to_json], 404, {'Content-type' => 'application/json'})
|
@@ -8,6 +8,8 @@ module Trogdir
|
|
8
8
|
expose(:scope) { |sync_log| sync_log.changeset.scope }
|
9
9
|
expose(:original) { |sync_log| sync_log.changeset.original }
|
10
10
|
expose(:modified) { |sync_log| sync_log.changeset.modified }
|
11
|
+
# #trackable doesn't exist after destroy, so use #try
|
12
|
+
expose(:all_attributes) { |sync_log| sync_log.changeset.trackable.try(:attributes) || {} }
|
11
13
|
expose(:created_at) { |sync_log| sync_log.changeset.created_at }
|
12
14
|
end
|
13
15
|
end
|
@@ -64,9 +64,11 @@ module Trogdir
|
|
64
64
|
optional :residence, type: String
|
65
65
|
optional :floor, type: Integer
|
66
66
|
optional :wing, type: String
|
67
|
+
optional :mailbox, type: String
|
67
68
|
|
68
69
|
# Academic
|
69
70
|
optional :majors, type: Array
|
71
|
+
optional :minors, type: Array
|
70
72
|
|
71
73
|
# FERPA
|
72
74
|
optional :privacy, type: Boolean
|
@@ -107,9 +109,11 @@ module Trogdir
|
|
107
109
|
optional :residence, type: String
|
108
110
|
optional :floor, type: Integer
|
109
111
|
optional :wing, type: String
|
112
|
+
optional :mailbox, type: String
|
110
113
|
|
111
114
|
# Academic
|
112
115
|
optional :majors, type: Array
|
116
|
+
optional :minors, type: Array
|
113
117
|
|
114
118
|
# FERPA
|
115
119
|
optional :privacy, type: Boolean
|
data/lib/trogdir_api.rb
CHANGED
data/lib/trogdir_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trogdir_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Crownoble
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: api-auth
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.4'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: hashie-forbidden_attributes
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.1'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.1'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: trogdir_models
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|