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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 59fce44ed554fdf1b800ba8c988f73ee19474f38
4
- data.tar.gz: 6c645d4a3a3e39c8e2a1f716981e4ca70f227b7a
3
+ metadata.gz: f5eae02ebddb3a522c550819032628f91da2ec72
4
+ data.tar.gz: 45d616eaa836d702cdd1e87a1811134da5e33aff
5
5
  SHA512:
6
- metadata.gz: 119d14d5f0b696a6d302fd1fffbe03b7a082d7d834753ec47e6a264ff4ec1a0cb1f6eb85a5408de31ab211c2626f6f06780e8400452b63e1109e1ab43f6f1163
7
- data.tar.gz: eea6d08e7f9ccc118be17d84690f7cbc91d8da24ec27006f6871a0fa05d6a79b954bf9e41b3b9befd846459ae1e86889702e2b631874cbdce874f9b546c2fb34
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
- if ENV['RACK_ENV'] == 'development'
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 { authenticate! }
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'})
@@ -30,9 +30,11 @@ module Trogdir
30
30
  :residence,
31
31
  :floor,
32
32
  :wing,
33
+ :mailbox,
33
34
 
34
35
  # Academic
35
36
  :majors,
37
+ :minors,
36
38
 
37
39
  # FERPA
38
40
  :privacy,
@@ -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
@@ -1,5 +1,6 @@
1
1
  require 'grape'
2
2
  require 'grape-entity'
3
+ require 'hashie-forbidden_attributes'
3
4
  require 'oj'
4
5
  require 'api_auth'
5
6
  require 'trogdir_models'
@@ -1,3 +1,3 @@
1
1
  module TrogdirAPI
2
- VERSION = '0.3.3'
2
+ VERSION = '0.3.4'
3
3
  end
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.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: 2014-11-08 00:00:00.000000000 Z
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