g5_updatable 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d5a406fd1c3178c4d1aeee35b2e3da6ff4881595
4
- data.tar.gz: 1c4a207ccce5b0dc7255a533b2bf1bfed50b5beb
3
+ metadata.gz: 39a571cc047013031bbb850d7f67c41f670f3538
4
+ data.tar.gz: 1b56bc2c70bb0eb86fda031069cbcb1c11f76f52
5
5
  SHA512:
6
- metadata.gz: 35cc9877178b939f95f7b737967d074cb984cd76ffedd00a40aeaa9f28f0ff3f7d7773965f00bea4d62bf1524a1506183f2b58237ab10f16fa321ee80847632c
7
- data.tar.gz: cf4f80ccb973ef3422ead18cf5cbc6b6b31fff7ce4e4e278e6c02f08f61432e9704328a6b971d647c6b14148940f40758f0b83818fda6bed44c769dbfcc3cc1b
6
+ metadata.gz: 9e8198dc412ba81cf5b4190e1a2bcd8e28203e29ed98e69136f5e7615b5ade82cd569a67545a104f7ee3c011b33b777c0bf1548c38e1ed8b676a3985548a0828
7
+ data.tar.gz: 0967808276864d27301e51554bfc23055d92273d8dee4eb1f1065e8f2328944a651873e7dd16ea91810af2bb6281a991fbb651493b29f291a6a6c35550b8d24c
@@ -1,4 +1,6 @@
1
1
  module G5Updatable
2
2
  class ApplicationController < ActionController::Base
3
+ skip_before_filter :authenticate_user!
4
+ skip_before_filter :verify_authenticity_token
3
5
  end
4
6
  end
@@ -1,7 +1,4 @@
1
1
  class G5Updatable::FeedController < ApplicationController
2
- skip_before_filter :authenticate_user!
3
- skip_before_filter :verify_authenticity_token
4
-
5
2
  def update
6
3
  G5Updatable::ClientFeedProcessor.new(params[:client_uid]).work
7
4
  render json: {}, status: :ok
@@ -0,0 +1,6 @@
1
+ class G5Updatable::LocationsController < ApplicationController
2
+ def show
3
+ @location = G5Updatable::Location.find_by_urn(params[:urn])
4
+ render json: @location
5
+ end
6
+ end
data/config/routes.rb CHANGED
@@ -1,3 +1,4 @@
1
1
  G5Updatable::Engine.routes.draw do
2
2
  post "/update" => "feed#update"
3
+ get "/locations/:urn" => "locations#show"
3
4
  end
@@ -1,3 +1,3 @@
1
1
  module G5Updatable
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ describe G5Updatable::LocationsController, type: :controller do
4
+ routes { G5Updatable::Engine.routes }
5
+
6
+ let!(:location) { create(:location) }
7
+
8
+ describe 'GET show' do
9
+ before { get :show, urn: location.urn }
10
+ subject { JSON.parse(response.body)['location'] }
11
+
12
+ its(['urn']) { is_expected.to eq(location.urn) }
13
+ its(['uid']) { is_expected.to eq(location.uid) }
14
+ end
15
+ end
@@ -0,0 +1,11 @@
1
+ development:
2
+ adapter: postgresql
3
+ database: g5_updatable_dummy_development
4
+ username: g5
5
+ password: rocks!
6
+
7
+ test:
8
+ adapter: postgresql
9
+ database: g5_updatable_dummy_test
10
+ username: g5
11
+ password: rocks!
@@ -0,0 +1,68 @@
1
+  (7.4ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) 
2
+  (12.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
4
+ Migrating to CreateLocations (20140630175259)
5
+  (0.1ms) BEGIN
6
+  (14.8ms) CREATE TABLE "locations" ("id" serial primary key, "uid" character varying(255), "name" character varying(255), "corporate" boolean, "urn" character varying(255), "state" character varying(255), "city" character varying(255), "street_address" character varying(255), "postal_code" character varying(255), "domain" character varying(255), "city_slug" character varying(255), "phone_number" character varying(255), "neighborhood" character varying(255), "primary_amenity" character varying(255), "primary_landmark" character varying(255), "qualifier" character varying(255), "floor_plans" character varying(255), "created_at" timestamp, "updated_at" timestamp) 
7
+ SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140630175259"]]
8
+  (6.3ms) COMMIT
9
+ Migrating to CreateClients (20140630175330)
10
+  (5.6ms) BEGIN
11
+  (12.3ms) CREATE TABLE "clients" ("id" serial primary key, "uid" character varying(255), "name" character varying(255), "vertical" character varying(255), "type" character varying(255), "domain" character varying(255), "created_at" timestamp, "updated_at" timestamp) 
12
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140630175330"]]
13
+  (0.3ms) COMMIT
14
+ Migrating to DropClientsAndLocations (20140709220627)
15
+  (0.1ms) BEGIN
16
+  (0.6ms) DROP TABLE "clients"
17
+  (0.4ms) DROP TABLE "locations"
18
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140709220627"]]
19
+  (1.0ms) COMMIT
20
+ Migrating to CreateG5UpdatableClientsAndLocations (20140709222005)
21
+  (0.1ms) BEGIN
22
+  (1.7ms) CREATE TABLE "g5_updatable_clients" ("id" serial primary key, "uid" character varying(255), "urn" character varying(255), "properties" json, "created_at" timestamp, "updated_at" timestamp)
23
+  (0.4ms) CREATE INDEX "index_g5_updatable_clients_on_uid" ON "g5_updatable_clients" ("uid")
24
+  (0.5ms) CREATE INDEX "index_g5_updatable_clients_on_urn" ON "g5_updatable_clients" ("urn")
25
+  (1.8ms) CREATE TABLE "g5_updatable_locations" ("id" serial primary key, "uid" character varying(255), "urn" character varying(255), "client_uid" character varying(255), "properties" json, "created_at" timestamp, "updated_at" timestamp) 
26
+  (0.4ms) CREATE INDEX "index_g5_updatable_locations_on_uid" ON "g5_updatable_locations" ("uid")
27
+  (0.4ms) CREATE INDEX "index_g5_updatable_locations_on_urn" ON "g5_updatable_locations" ("urn")
28
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140709222005"]]
29
+  (0.3ms) COMMIT
30
+ Migrating to CreateFavoriteFoods (20140714225203)
31
+  (0.3ms) BEGIN
32
+  (2.0ms) CREATE TABLE "favorite_foods" ("id" serial primary key, "name" character varying(255), "location_uid" character varying(255), "created_at" timestamp, "updated_at" timestamp) 
33
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20140714225203"]]
34
+  (0.2ms) COMMIT
35
+ Migrating to CreateIntegrationSetting (20141030211945)
36
+  (0.2ms) BEGIN
37
+  (2.7ms) CREATE TABLE "g5_updatable_integration_settings" ("id" serial primary key, "uid" character varying(255), "urn" character varying(255), "location_uid" character varying(255), "vendor_action" character varying(255), "job_frequency_in_minutes" integer, "properties" json, "created_at" timestamp, "updated_at" timestamp) 
38
+  (0.8ms) CREATE INDEX "index_g5_updatable_integration_settings_on_urn" ON "g5_updatable_integration_settings" ("urn")
39
+  (0.9ms) CREATE INDEX "index_g5_updatable_integration_settings_on_uid" ON "g5_updatable_integration_settings" ("uid")
40
+  (0.8ms) CREATE INDEX "index_g5_updatable_integration_settings_on_vendor_action" ON "g5_updatable_integration_settings" ("vendor_action")
41
+  (0.6ms) CREATE INDEX "g5_u_is_loc_action" ON "g5_updatable_integration_settings" ("location_uid", "vendor_action")
42
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141030211945"]]
43
+  (0.2ms) COMMIT
44
+ Migrating to RemoveIntegrationSetting (20141122211945)
45
+  (0.1ms) BEGIN
46
+  (0.6ms) DROP TABLE "g5_updatable_integration_settings"
47
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141122211945"]]
48
+  (0.8ms) COMMIT
49
+ Migrating to AddNameToClientsAndLocations (20141211211945)
50
+  (0.1ms) BEGIN
51
+  (0.3ms) ALTER TABLE "g5_updatable_clients" ADD COLUMN "name" character varying(255)
52
+  (0.8ms) CREATE INDEX "index_g5_updatable_clients_on_name" ON "g5_updatable_clients" ("name")
53
+  (0.2ms) ALTER TABLE "g5_updatable_locations" ADD COLUMN "name" character varying(255)
54
+  (0.8ms) CREATE INDEX "index_g5_updatable_locations_on_name" ON "g5_updatable_locations" ("name")
55
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141211211945"]]
56
+  (0.3ms) COMMIT
57
+ Migrating to UpdateNames (20141211711945)
58
+  (0.1ms) BEGIN
59
+ G5Updatable::Client Load (0.6ms) SELECT "g5_updatable_clients".* FROM "g5_updatable_clients"
60
+ G5Updatable::Location Load (0.4ms) SELECT "g5_updatable_locations".* FROM "g5_updatable_locations"
61
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141211711945"]]
62
+  (0.3ms) COMMIT
63
+ Migrating to CreateRestaurants (20141222072623)
64
+  (0.1ms) BEGIN
65
+  (2.0ms) CREATE TABLE "restaurants" ("id" serial primary key, "name" character varying(255), "client_uid" character varying(255), "created_at" timestamp, "updated_at" timestamp) 
66
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20141222072623"]]
67
+  (0.2ms) COMMIT
68
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"