openstax_api 2.2.1 → 2.2.2

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: 9b38439560a0b92bdaea0233f25c382459e9bdb6
4
- data.tar.gz: 77da1ed44f1a29c8e8cb8e20749fd6e46ee959e3
3
+ metadata.gz: 0d1548c720a9fd4fdf2e54f8b005019e81504d99
4
+ data.tar.gz: 9bf3a7b1602fd86666e7db95df285cf55048b3c5
5
5
  SHA512:
6
- metadata.gz: b7426278c69fa995d6f4efe96a7c490a719f8e6be3cd6828533aed799937d8a894933c306afb19915b695d45751b11849c00e5e7c6f2c616cd91c400d0c84753
7
- data.tar.gz: a572244a0cec476924341f2f64ed6b9c5db5f3bea63d5fd6afe1d860bdfdc79040d50cc421b3834d2f09ae20dbb5800d0938ce93ba270031a6beeb49d836ab48
6
+ metadata.gz: 0b1d6867b462d6a264ea79a4c92db1e5a1bc250122fc2ab4c5b11497f52b96246caadb04ccc114022dafe05f93bddc3e7c0758014290ae44855bb07dc023b84a
7
+ data.tar.gz: 4acd371f45b872aa4a04cfd8ca44a0454052c8688f1db3fc4cbddab3a13ca475087dc9a29a7d0fbc14431cdc4ae48300812c9475a2e3678eb23b6bdb6ae79938
@@ -23,7 +23,9 @@ module OpenStax
23
23
  protected
24
24
 
25
25
  def self.representer_name(representer)
26
- representer.name.chomp('Representer').demodulize.camelize(:lower)
26
+ name = representer.name
27
+ return nil if name.nil?
28
+ name.chomp('Representer').demodulize.camelize(:lower)
27
29
  end
28
30
 
29
31
  def self.definition_name(name)
@@ -65,26 +67,27 @@ module OpenStax
65
67
  # Overwrite type for collections
66
68
  attr_info[:type] = 'array' if attr[:collection]
67
69
 
68
- if attr[:use_decorator]
69
- # Implicit representer - nest attributes
70
- decorator = attr[:extend].evaluate(self)
71
- attr_info.merge!(json_object(decorator, definitions, options))
72
- elsif attr[:extend]
73
- # Explicit representer - use reference
70
+ if attr[:extend]
71
+ # Nested representer
74
72
  decorator = attr[:extend].evaluate(self)
75
73
  rname = representer_name(decorator)
76
- dname = definition_name(rname)
77
74
 
78
- if attr[:collection]
79
- attr_info[:items] = { :$ref => dname }
75
+ if rname
76
+ dname = definition_name(rname)
77
+
78
+ if attr[:collection]
79
+ attr_info[:items] = { :$ref => dname }
80
+ else
81
+ # Type is included in ref
82
+ attr_info.delete(:type)
83
+ attr_info[:$ref] = dname
84
+ end
85
+
86
+ definitions[rname] ||= json_object(decorator,
87
+ definitions, options)
80
88
  else
81
- # Type is included in ref
82
- attr_info.delete(:type)
83
- attr_info[:$ref] = dname
89
+ attr_info.merge!(json_object(decorator, definitions, options))
84
90
  end
85
-
86
- definitions[rname] ||= json_object(decorator,
87
- definitions, options)
88
91
  end
89
92
 
90
93
  schema[:properties][name.to_sym] = attr_info
@@ -1,5 +1,5 @@
1
1
  module OpenStax
2
2
  module Api
3
- VERSION = "2.2.1"
3
+ VERSION = "2.2.2"
4
4
  end
5
5
  end
Binary file
@@ -1420,3 +1420,20 @@ Connecting to database specified by database.yml
1420
1420
   (0.8ms) CREATE TABLE "oauth_applications" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) NOT NULL, "uid" varchar(255) NOT NULL, "secret" varchar(255) NOT NULL, "redirect_uri" text NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1421
1421
   (0.8ms) CREATE UNIQUE INDEX "index_oauth_applications_on_uid" ON "oauth_applications" ("uid")
1422
1422
   (0.1ms) SELECT version FROM "schema_migrations"
1423
+ Connecting to database specified by database.yml
1424
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
1425
+  (0.3ms) select sqlite_version(*)
1426
+  (1.2ms) DROP TABLE "dummy_users"
1427
+  (0.7ms) CREATE TABLE "dummy_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "username" varchar(255), "password_hash" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1428
+  (0.6ms) DROP TABLE "oauth_access_grants"
1429
+  (0.6ms) CREATE TABLE "oauth_access_grants" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "resource_owner_id" integer NOT NULL, "application_id" integer NOT NULL, "token" varchar(255) NOT NULL, "expires_in" integer NOT NULL, "redirect_uri" text NOT NULL, "created_at" datetime NOT NULL, "revoked_at" datetime, "scopes" varchar(255))
1430
+  (0.7ms) CREATE UNIQUE INDEX "index_oauth_access_grants_on_token" ON "oauth_access_grants" ("token")
1431
+  (0.7ms) DROP TABLE "oauth_access_tokens"
1432
+  (0.7ms) CREATE TABLE "oauth_access_tokens" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "resource_owner_id" integer, "application_id" integer, "token" varchar(255) NOT NULL, "refresh_token" varchar(255), "expires_in" integer, "revoked_at" datetime, "created_at" datetime NOT NULL, "scopes" varchar(255)) 
1433
+  (0.6ms) CREATE UNIQUE INDEX "index_oauth_access_tokens_on_refresh_token" ON "oauth_access_tokens" ("refresh_token")
1434
+  (0.6ms) CREATE INDEX "index_oauth_access_tokens_on_resource_owner_id" ON "oauth_access_tokens" ("resource_owner_id")
1435
+  (0.7ms) CREATE UNIQUE INDEX "index_oauth_access_tokens_on_token" ON "oauth_access_tokens" ("token")
1436
+  (0.6ms) DROP TABLE "oauth_applications"
1437
+  (0.8ms) CREATE TABLE "oauth_applications" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) NOT NULL, "uid" varchar(255) NOT NULL, "secret" varchar(255) NOT NULL, "redirect_uri" text NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1438
+  (0.6ms) CREATE UNIQUE INDEX "index_oauth_applications_on_uid" ON "oauth_applications" ("uid")
1439
+  (0.1ms) SELECT version FROM "schema_migrations"
@@ -2201,3 +2201,40 @@ Connecting to database specified by database.yml
2201
2201
   (0.0ms) rollback transaction
2202
2202
   (0.0ms) begin transaction
2203
2203
   (0.0ms) rollback transaction
2204
+ Connecting to database specified by database.yml
2205
+  (0.4ms) begin transaction
2206
+  (0.0ms) rollback transaction
2207
+  (0.0ms) begin transaction
2208
+ DummyUser Load (0.1ms) SELECT "dummy_users".* FROM "dummy_users" WHERE "dummy_users"."id" IS NULL LIMIT 1
2209
+  (0.0ms) rollback transaction
2210
+  (0.0ms) begin transaction
2211
+  (0.0ms) SAVEPOINT active_record_1
2212
+ SQL (2.3ms) INSERT INTO "dummy_users" ("created_at", "password_hash", "updated_at", "username") VALUES (?, ?, ?, ?) [["created_at", Wed, 02 Jul 2014 22:42:02 UTC +00:00], ["password_hash", nil], ["updated_at", Wed, 02 Jul 2014 22:42:02 UTC +00:00], ["username", nil]]
2213
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2214
+ DummyUser Load (0.1ms) SELECT "dummy_users".* FROM "dummy_users" WHERE "dummy_users"."id" = 1 LIMIT 1
2215
+  (0.8ms) rollback transaction
2216
+  (0.0ms) begin transaction
2217
+  (0.0ms) SAVEPOINT active_record_1
2218
+ SQL (0.2ms) INSERT INTO "dummy_users" ("created_at", "password_hash", "updated_at", "username") VALUES (?, ?, ?, ?) [["created_at", Wed, 02 Jul 2014 22:42:02 UTC +00:00], ["password_hash", nil], ["updated_at", Wed, 02 Jul 2014 22:42:02 UTC +00:00], ["username", nil]]
2219
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2220
+  (0.3ms) rollback transaction
2221
+  (0.0ms) begin transaction
2222
+  (0.0ms) rollback transaction
2223
+  (0.0ms) begin transaction
2224
+  (0.0ms) rollback transaction
2225
+  (0.0ms) begin transaction
2226
+  (0.0ms) rollback transaction
2227
+  (0.0ms) begin transaction
2228
+  (0.0ms) rollback transaction
2229
+  (0.0ms) begin transaction
2230
+  (0.0ms) rollback transaction
2231
+  (0.0ms) begin transaction
2232
+  (0.0ms) rollback transaction
2233
+  (0.0ms) begin transaction
2234
+  (0.0ms) rollback transaction
2235
+  (0.0ms) begin transaction
2236
+  (0.0ms) rollback transaction
2237
+  (0.0ms) begin transaction
2238
+  (0.0ms) rollback transaction
2239
+  (0.0ms) begin transaction
2240
+  (0.0ms) rollback transaction
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstax_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dante Soares