apidae 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/apidae/import_controller.rb +19 -12
- data/app/models/apidae/application_record.rb +5 -0
- data/app/models/apidae/object.rb +37 -21
- data/app/models/apidae/selection.rb +16 -5
- data/app/models/apidae/selection_object.rb +6 -0
- data/db/migrate/20170512212941_create_apidae_selections.rb +1 -1
- data/db/migrate/20170512214641_create_apidae_objects.rb +1 -1
- data/db/migrate/20170512221525_create_apidae_objects_apidae_selections.rb +1 -1
- data/db/migrate/20170513114002_create_apidae_towns.rb +1 -1
- data/db/migrate/20170513114409_add_town_insee_code_to_objects.rb +1 -1
- data/db/migrate/20170513115401_add_pictures_data_to_objects.rb +1 -1
- data/db/migrate/20170513121215_create_apidae_attached_files.rb +1 -1
- data/db/migrate/20170513205932_rename_objects_selections_table.rb +1 -1
- data/db/migrate/20170720161134_add_entity_data_to_objects.rb +1 -1
- data/db/migrate/20170730102424_create_apidae_file_imports.rb +1 -1
- data/db/migrate/20171025075304_create_apidae_exports.rb +1 -1
- data/db/migrate/20180217222410_create_apidae_selection_objects.rb +10 -0
- data/db/migrate/20180218172704_change_text_columns_to_json.rb +10 -0
- data/db/migrate/20180218231319_add_service_data_to_apidae_objects.rb +5 -0
- data/lib/apidae/version.rb +1 -1
- data/test/dummy/config/application.rb +0 -3
- data/test/dummy/db/schema.rb +70 -64
- data/test/dummy/log/development.log +95 -0
- data/test/fixtures/apidae/selection_objects.yml +9 -0
- data/test/models/apidae/selection_object_test.rb +9 -0
- metadata +12 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0a3a4373bd30afc262811bcf084f5c6d047b064
|
4
|
+
data.tar.gz: 18bd22b43a8ac17470a989cc7c9d5fc05e8fc0f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b84b9f9ecf1c2dbbf66ec0d4b31ed9faac0556094b9c1fd53c66a9a4810b663cd4e5295ba1e21210024a7f2069ed342c87738e8eb5f1afd1613cf093d4e2488
|
7
|
+
data.tar.gz: acbbbb5cb56bfac471ed1a36cb7bc171bdc3260ef592aa8a2cd457aeb1183e3b1e04130d834f9beabd2ceb0ba48736ca91cec8c71cb6d8783e7a0f23590f21f9
|
@@ -33,20 +33,27 @@ module Apidae
|
|
33
33
|
def run
|
34
34
|
success = true
|
35
35
|
Export.pending.each do |e|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
36
|
+
begin
|
37
|
+
open(e.file_url) do |f|
|
38
|
+
begin
|
39
|
+
FileImport.import(f)
|
40
|
+
uri = URI(e.confirm_url)
|
41
|
+
req = Net::HTTP::Post.new(uri)
|
42
|
+
Net::HTTP.start(uri.hostname, uri.port) do |http|
|
43
|
+
http.request(req)
|
44
|
+
end
|
45
|
+
e.update(status: Export::COMPLETE)
|
46
|
+
rescue Exception => ex
|
47
|
+
logger.error("Failed to import export file : #{e.file_url}")
|
48
|
+
logger.error("Error is : #{ex} \n#{ex.backtrace.join("\n") unless ex.backtrace.blank?}")
|
49
|
+
success = false
|
43
50
|
end
|
44
|
-
e.update(status: Export::COMPLETE)
|
45
|
-
rescue Exception => ex
|
46
|
-
logger.error("Failed to retrieve export file : #{ex.file_url}")
|
47
|
-
logger.error("Error is : #{ex}")
|
48
|
-
success = false
|
49
51
|
end
|
52
|
+
rescue OpenURI::HTTPError => err
|
53
|
+
logger.error("Failed to download export file : #{e.file_url}")
|
54
|
+
logger.error("Error is : #{err}")
|
55
|
+
success = false
|
56
|
+
e.update(status: Export::CANCELLED)
|
50
57
|
end
|
51
58
|
end
|
52
59
|
render nothing: true, status: (success ? :ok : :internal_server_error)
|
data/app/models/apidae/object.rb
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
module Apidae
|
2
2
|
class Object < ActiveRecord::Base
|
3
3
|
|
4
|
-
belongs_to :town, :
|
5
|
-
has_many :attached_files, :
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
4
|
+
belongs_to :town, class_name: 'Apidae::Town', foreign_key: :town_insee_code, primary_key: :insee_code
|
5
|
+
has_many :attached_files, class_name: 'Apidae::AttachedFile'
|
6
|
+
has_many :apidae_selection_objects, class_name: 'Apidae::SelectionObject', foreign_key: :apidae_object_id
|
7
|
+
has_many :selections, class_name: 'Apidae::Selection', source: :apidae_selection, through: :apidae_selection_objects
|
8
|
+
|
9
|
+
store_accessor :pictures_data, :pictures
|
10
|
+
store_accessor :type_data, :categories, :themes, :capacite, :classement
|
11
|
+
store_accessor :entity_data, :entity_id, :entity_name
|
12
|
+
store_accessor :contact, :telephone, :email, :website
|
13
|
+
store_accessor :address, :address_fields
|
14
|
+
store_accessor :openings, :description, :opening_periods
|
14
15
|
|
15
16
|
ACT = 'ACTIVITE'
|
16
17
|
COS = 'COMMERCE_ET_SERVICE'
|
@@ -60,7 +61,7 @@ module Apidae
|
|
60
61
|
def self.update_object(apidae_obj, object_data)
|
61
62
|
type_fields = TYPES_DATA[object_data[:type]]
|
62
63
|
apidae_obj.apidae_type = object_data[:type]
|
63
|
-
apidae_obj.apidae_subtype =
|
64
|
+
apidae_obj.apidae_subtype = node_id(object_data[type_fields[:node]], type_fields[:subtype])
|
64
65
|
apidae_obj.title = node_value(object_data, :nom)
|
65
66
|
apidae_obj.short_desc = node_value(object_data[:presentation], :descriptifCourt)
|
66
67
|
apidae_obj.long_desc = node_value(object_data[:presentation], :descriptifDetaille)
|
@@ -75,6 +76,7 @@ module Apidae
|
|
75
76
|
apidae_obj.type_data = object_data[type_fields[:node]]
|
76
77
|
apidae_obj.pictures_data = pictures_urls(object_data[:illustrations])
|
77
78
|
apidae_obj.entity_data = entity_fields(object_data[:informations])
|
79
|
+
apidae_obj.service_data = object_data[:prestations]
|
78
80
|
apidae_obj.save!
|
79
81
|
end
|
80
82
|
|
@@ -112,24 +114,30 @@ module Apidae
|
|
112
114
|
|
113
115
|
def self.address(address_hash)
|
114
116
|
computed_address = []
|
115
|
-
|
116
|
-
|
117
|
-
|
117
|
+
unless address_hash.blank?
|
118
|
+
computed_address << address_hash[:adresse1] unless address_hash[:adresse1].blank?
|
119
|
+
computed_address << address_hash[:adresse2] unless address_hash[:adresse2].blank?
|
120
|
+
computed_address << address_hash[:adresse3] unless address_hash[:adresse3].blank?
|
121
|
+
end
|
118
122
|
{address_fields: computed_address}
|
119
123
|
end
|
120
124
|
|
121
|
-
def self.town(address_hash)
|
122
|
-
address_hash[:commune] ? Town.find_by_apidae_id(address_hash[:commune][:id]) : nil
|
125
|
+
def self.town(address_hash = {})
|
126
|
+
(!address_hash.blank? && address_hash[:commune]) ? Town.find_by_apidae_id(address_hash[:commune][:id]) : nil
|
123
127
|
end
|
124
128
|
|
125
129
|
def self.latitude(location_hash)
|
126
|
-
|
127
|
-
|
130
|
+
unless location_hash.blank?
|
131
|
+
geoloc_details = location_hash[:geolocalisation]
|
132
|
+
(geoloc_details && geoloc_details[:valide] && geoloc_details[:geoJson]) ? geoloc_details[:geoJson][:coordinates][1] : nil
|
133
|
+
end
|
128
134
|
end
|
129
135
|
|
130
|
-
def self.longitude(location_hash)
|
131
|
-
|
132
|
-
|
136
|
+
def self.longitude(location_hash = {})
|
137
|
+
unless location_hash.blank?
|
138
|
+
geoloc_details = location_hash[:geolocalisation]
|
139
|
+
(geoloc_details && geoloc_details[:valide] && geoloc_details[:geoJson]) ? geoloc_details[:geoJson][:coordinates][0] : nil
|
140
|
+
end
|
133
141
|
end
|
134
142
|
|
135
143
|
def self.openings(openings_hash)
|
@@ -185,5 +193,13 @@ module Apidae
|
|
185
193
|
''
|
186
194
|
end
|
187
195
|
end
|
196
|
+
|
197
|
+
def self.node_id(node, key)
|
198
|
+
if node && node[key]
|
199
|
+
node[key][:id]
|
200
|
+
else
|
201
|
+
''
|
202
|
+
end
|
203
|
+
end
|
188
204
|
end
|
189
205
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module Apidae
|
2
2
|
class Selection < ActiveRecord::Base
|
3
|
-
|
3
|
+
has_many :apidae_selection_objects, class_name: 'Apidae::SelectionObject', foreign_key: :apidae_selection_id
|
4
|
+
has_many :objects, class_name: 'Apidae::Object', source: :apidae_object, through: :apidae_selection_objects
|
4
5
|
|
5
6
|
MAX_COUNT = 100
|
6
7
|
MAX_LOOPS = 10
|
@@ -14,19 +15,21 @@ module Apidae
|
|
14
15
|
apidae_sel.label = selection_data[:nom]
|
15
16
|
apidae_sel.save!
|
16
17
|
|
18
|
+
# Note : should be done with basic collection assignment, but can't make it work...
|
17
19
|
current_objs = apidae_sel.objects.collect {|obj| obj.apidae_id}
|
18
20
|
imported_objs = selection_data[:objetsTouristiques].blank? ? [] : selection_data[:objetsTouristiques].collect {|obj| obj[:id]}
|
21
|
+
|
19
22
|
added = imported_objs - current_objs
|
20
23
|
removed = current_objs - imported_objs
|
21
24
|
|
22
25
|
added.each do |o|
|
23
|
-
|
24
|
-
apidae_sel.
|
26
|
+
obj = Apidae::Object.find_by_apidae_id(o)
|
27
|
+
Apidae::SelectionObject.create(apidae_selection_id: apidae_sel.id, apidae_object_id: obj.id)
|
25
28
|
end
|
26
29
|
|
27
30
|
removed.each do |o|
|
28
|
-
|
29
|
-
apidae_sel.
|
31
|
+
obj = Apidae::Object.find_by_apidae_id(o)
|
32
|
+
Apidae::SelectionObject.destroy(apidae_selection_id: apidae_sel.id, apidae_object_id: obj.id)
|
30
33
|
end
|
31
34
|
end
|
32
35
|
|
@@ -65,6 +68,14 @@ module Apidae
|
|
65
68
|
agenda_entries
|
66
69
|
end
|
67
70
|
|
71
|
+
def results(where_clause, offset, size)
|
72
|
+
objects.includes(:town).limit(size).offset(offset).where(where_clause)
|
73
|
+
end
|
74
|
+
|
75
|
+
def total(where_clause)
|
76
|
+
objects.where(where_clause).count
|
77
|
+
end
|
78
|
+
|
68
79
|
private
|
69
80
|
|
70
81
|
def get_response(config)
|
@@ -0,0 +1,10 @@
|
|
1
|
+
class ChangeTextColumnsToJson < ActiveRecord::Migration[5.1]
|
2
|
+
def change
|
3
|
+
change_column :apidae_objects, :pictures_data, :jsonb, using: 'pictures_data::text::jsonb'
|
4
|
+
change_column :apidae_objects, :type_data, :jsonb, using: 'type_data::text::jsonb'
|
5
|
+
change_column :apidae_objects, :entity_data, :jsonb, using: 'entity_data::text::jsonb'
|
6
|
+
change_column :apidae_objects, :contact, :jsonb, using: 'contact::text::jsonb'
|
7
|
+
change_column :apidae_objects, :address, :jsonb, using: 'address::text::jsonb'
|
8
|
+
change_column :apidae_objects, :openings, :jsonb, using: 'openings::text::jsonb'
|
9
|
+
end
|
10
|
+
end
|
data/lib/apidae/version.rb
CHANGED
@@ -18,9 +18,6 @@ module Dummy
|
|
18
18
|
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
19
19
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
20
20
|
# config.i18n.default_locale = :de
|
21
|
-
|
22
|
-
# Do not swallow errors in after_commit/after_rollback callbacks.
|
23
|
-
config.active_record.raise_in_transactional_callbacks = true
|
24
21
|
end
|
25
22
|
end
|
26
23
|
|
data/test/dummy/db/schema.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: UTF-8
|
2
1
|
# This file is auto-generated from the current state of the database. Instead
|
3
2
|
# of editing this file, please use the migrations feature of Active Record to
|
4
3
|
# incrementally modify your database, and then regenerate this schema definition.
|
@@ -11,91 +10,98 @@
|
|
11
10
|
#
|
12
11
|
# It's strongly recommended that you check this file into your version control system.
|
13
12
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
13
|
+
ActiveRecord::Schema.define(version: 20180218231319) do
|
15
14
|
|
16
15
|
# These are extensions that must be enabled in order to support this database
|
17
16
|
enable_extension "plpgsql"
|
18
17
|
|
19
|
-
create_table "apidae_attached_files", force: :cascade do |t|
|
20
|
-
t.string
|
21
|
-
t.string
|
22
|
-
t.text
|
23
|
-
t.integer
|
24
|
-
t.string
|
25
|
-
t.string
|
26
|
-
t.integer
|
18
|
+
create_table "apidae_attached_files", id: :serial, force: :cascade do |t|
|
19
|
+
t.string "name"
|
20
|
+
t.string "credits"
|
21
|
+
t.text "description"
|
22
|
+
t.integer "apidae_object_id"
|
23
|
+
t.string "picture_file_name"
|
24
|
+
t.string "picture_content_type"
|
25
|
+
t.integer "picture_file_size"
|
27
26
|
t.datetime "picture_updated_at"
|
28
|
-
t.datetime "created_at",
|
29
|
-
t.datetime "updated_at",
|
27
|
+
t.datetime "created_at", null: false
|
28
|
+
t.datetime "updated_at", null: false
|
30
29
|
end
|
31
30
|
|
32
|
-
create_table "apidae_exports", force: :cascade do |t|
|
33
|
-
t.string
|
34
|
-
t.string
|
35
|
-
t.boolean
|
36
|
-
t.boolean
|
37
|
-
t.string
|
38
|
-
t.string
|
39
|
-
t.integer
|
40
|
-
t.datetime "created_at",
|
41
|
-
t.datetime "updated_at",
|
31
|
+
create_table "apidae_exports", id: :serial, force: :cascade do |t|
|
32
|
+
t.string "status"
|
33
|
+
t.string "remote_status"
|
34
|
+
t.boolean "oneshot"
|
35
|
+
t.boolean "reset"
|
36
|
+
t.string "file_url"
|
37
|
+
t.string "confirm_url"
|
38
|
+
t.integer "project_id"
|
39
|
+
t.datetime "created_at", null: false
|
40
|
+
t.datetime "updated_at", null: false
|
42
41
|
end
|
43
42
|
|
44
|
-
create_table "apidae_file_imports", force: :cascade do |t|
|
45
|
-
t.string
|
46
|
-
t.string
|
47
|
-
t.integer
|
48
|
-
t.integer
|
49
|
-
t.integer
|
50
|
-
t.datetime "created_at",
|
51
|
-
t.datetime "updated_at",
|
43
|
+
create_table "apidae_file_imports", id: :serial, force: :cascade do |t|
|
44
|
+
t.string "status"
|
45
|
+
t.string "remote_file"
|
46
|
+
t.integer "created"
|
47
|
+
t.integer "updated"
|
48
|
+
t.integer "deleted"
|
49
|
+
t.datetime "created_at", null: false
|
50
|
+
t.datetime "updated_at", null: false
|
52
51
|
end
|
53
52
|
|
54
|
-
create_table "apidae_objects", force: :cascade do |t|
|
55
|
-
t.
|
56
|
-
t.integer
|
57
|
-
t.string
|
58
|
-
t.string
|
59
|
-
t.string
|
60
|
-
t.text
|
61
|
-
t.
|
62
|
-
t.text
|
63
|
-
t.
|
64
|
-
t.float
|
65
|
-
t.float
|
66
|
-
t.
|
67
|
-
t.text
|
68
|
-
t.text
|
69
|
-
t.datetime "created_at",
|
70
|
-
t.datetime "updated_at",
|
71
|
-
t.string
|
72
|
-
t.
|
73
|
-
t.
|
53
|
+
create_table "apidae_objects", id: :serial, force: :cascade do |t|
|
54
|
+
t.jsonb "address"
|
55
|
+
t.integer "apidae_id"
|
56
|
+
t.string "apidae_type"
|
57
|
+
t.string "apidae_subtype"
|
58
|
+
t.string "title"
|
59
|
+
t.text "short_desc"
|
60
|
+
t.jsonb "contact"
|
61
|
+
t.text "long_desc"
|
62
|
+
t.jsonb "type_data"
|
63
|
+
t.float "latitude"
|
64
|
+
t.float "longitude"
|
65
|
+
t.jsonb "openings"
|
66
|
+
t.text "rates"
|
67
|
+
t.text "reservation"
|
68
|
+
t.datetime "created_at", null: false
|
69
|
+
t.datetime "updated_at", null: false
|
70
|
+
t.string "town_insee_code"
|
71
|
+
t.jsonb "pictures_data"
|
72
|
+
t.jsonb "entity_data"
|
73
|
+
t.jsonb "service_data"
|
74
74
|
end
|
75
75
|
|
76
|
-
create_table "apidae_objects_selections", force: :cascade do |t|
|
76
|
+
create_table "apidae_objects_selections", id: :serial, force: :cascade do |t|
|
77
77
|
t.integer "object_id"
|
78
78
|
t.integer "selection_id"
|
79
79
|
end
|
80
80
|
|
81
|
-
create_table "
|
82
|
-
t.
|
83
|
-
t.
|
84
|
-
t.integer "apidae_id"
|
81
|
+
create_table "apidae_selection_objects", force: :cascade do |t|
|
82
|
+
t.integer "apidae_selection_id"
|
83
|
+
t.integer "apidae_object_id"
|
85
84
|
t.datetime "created_at", null: false
|
86
85
|
t.datetime "updated_at", null: false
|
87
86
|
end
|
88
87
|
|
89
|
-
create_table "
|
90
|
-
t.string
|
91
|
-
t.
|
92
|
-
t.
|
93
|
-
t.
|
94
|
-
t.
|
95
|
-
t.datetime "created_at", null: false
|
96
|
-
t.datetime "updated_at", null: false
|
88
|
+
create_table "apidae_selections", id: :serial, force: :cascade do |t|
|
89
|
+
t.string "label"
|
90
|
+
t.string "reference"
|
91
|
+
t.integer "apidae_id"
|
92
|
+
t.datetime "created_at", null: false
|
93
|
+
t.datetime "updated_at", null: false
|
97
94
|
end
|
98
95
|
|
99
|
-
|
96
|
+
create_table "apidae_towns", id: :serial, force: :cascade do |t|
|
97
|
+
t.string "country"
|
98
|
+
t.integer "apidae_id"
|
99
|
+
t.string "insee_code"
|
100
|
+
t.string "name"
|
101
|
+
t.string "postal_code"
|
102
|
+
t.datetime "created_at", null: false
|
103
|
+
t.datetime "updated_at", null: false
|
104
|
+
t.index ["insee_code"], name: "index_apidae_towns_on_insee_code", unique: true
|
105
|
+
end
|
100
106
|
|
101
107
|
end
|
@@ -188,3 +188,98 @@ WHERE c.contype = 'f'
|
|
188
188
|
ORDER BY c.conname
|
189
189
|
[0m
|
190
190
|
DEPRECATION WARNING: Defining a route where `to` is a controller without an action is deprecated. Please change `to: 'dashboard/index'` to `controller: 'dashboard/index'`. (called from block in <top (required)> at /Users/jbvilain/workspace/code/apidae-engine-rails/config/routes.rb:9)
|
191
|
+
[1m[35m (45.2ms)[0m [1m[35mCREATE TABLE "ar_internal_metadata" ("key" character varying NOT NULL PRIMARY KEY, "value" character varying, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)[0m
|
192
|
+
[1m[35m (2.4ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
193
|
+
[1m[35m (5.3ms)[0m [1m[34mSELECT pg_try_advisory_lock(6140174353533887940)[0m
|
194
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
195
|
+
Migrating to AddPicturesDataToObjects (20170513115401)
|
196
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT pg_advisory_unlock(6140174353533887940)[0m
|
197
|
+
[1m[35m (0.4ms)[0m [1m[34mSELECT pg_try_advisory_lock(6140174353533887940)[0m
|
198
|
+
[1m[35m (1.1ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
199
|
+
Migrating to CreateApidaeAttachedFiles (20170513121215)
|
200
|
+
[1m[35m (11.7ms)[0m [1m[35mBEGIN[0m
|
201
|
+
[1m[35m (24.3ms)[0m [1m[35mCREATE TABLE "apidae_attached_files" ("id" serial NOT NULL PRIMARY KEY, "name" character varying, "credits" character varying, "description" text, "apidae_object_id" integer, "picture_file_name" character varying, "picture_content_type" character varying, "picture_file_size" integer, "picture_updated_at" timestamp, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)[0m
|
202
|
+
[1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version"[0m [["version", "20170513121215"]]
|
203
|
+
[1m[35m (0.6ms)[0m [1m[35mCOMMIT[0m
|
204
|
+
Migrating to RenameObjectsSelectionsTable (20170513205932)
|
205
|
+
[1m[35m (6.0ms)[0m [1m[35mBEGIN[0m
|
206
|
+
[1m[35m (18.8ms)[0m [1m[35mALTER TABLE "apidae_objects_apidae_selections" RENAME TO "apidae_objects_selections"[0m
|
207
|
+
[1m[35m (0.4ms)[0m [1m[35mALTER TABLE "public"."apidae_objects_apidae_selections_id_seq" RENAME TO "apidae_objects_selections_id_seq"[0m
|
208
|
+
[1m[35m (0.3ms)[0m [1m[35mALTER INDEX "apidae_objects_apidae_selections_pkey" RENAME TO "apidae_objects_selections_pkey"[0m
|
209
|
+
[1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version"[0m [["version", "20170513205932"]]
|
210
|
+
[1m[35m (0.4ms)[0m [1m[35mCOMMIT[0m
|
211
|
+
Migrating to AddEntityDataToObjects (20170720161134)
|
212
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
213
|
+
[1m[35m (10.3ms)[0m [1m[35mALTER TABLE "apidae_objects" ADD "entity_data" text[0m
|
214
|
+
[1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version"[0m [["version", "20170720161134"]]
|
215
|
+
[1m[35m (6.3ms)[0m [1m[35mCOMMIT[0m
|
216
|
+
Migrating to CreateApidaeFileImports (20170730102424)
|
217
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
218
|
+
[1m[35m (21.6ms)[0m [1m[35mCREATE TABLE "apidae_file_imports" ("id" serial NOT NULL PRIMARY KEY, "status" character varying, "remote_file" character varying, "created" integer, "updated" integer, "deleted" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)[0m
|
219
|
+
[1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version"[0m [["version", "20170730102424"]]
|
220
|
+
[1m[35m (0.6ms)[0m [1m[35mCOMMIT[0m
|
221
|
+
Migrating to CreateApidaeExports (20171025075304)
|
222
|
+
[1m[35m (6.2ms)[0m [1m[35mBEGIN[0m
|
223
|
+
[1m[35m (15.7ms)[0m [1m[35mCREATE TABLE "apidae_exports" ("id" serial NOT NULL PRIMARY KEY, "status" character varying, "remote_status" character varying, "oneshot" boolean, "reset" boolean, "file_url" character varying, "confirm_url" character varying, "project_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)[0m
|
224
|
+
[1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version"[0m [["version", "20171025075304"]]
|
225
|
+
[1m[35m (0.5ms)[0m [1m[35mCOMMIT[0m
|
226
|
+
Migrating to CreateApidaeSelectionObjects (20180217222410)
|
227
|
+
[1m[35m (6.3ms)[0m [1m[35mBEGIN[0m
|
228
|
+
[1m[35m (8.9ms)[0m [1m[35mCREATE TABLE "apidae_selection_objects" ("id" bigserial primary key, "apidae_selection_id" integer, "apidae_object_id" integer, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)[0m
|
229
|
+
[1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version"[0m [["version", "20180217222410"]]
|
230
|
+
[1m[35m (6.0ms)[0m [1m[35mCOMMIT[0m
|
231
|
+
Migrating to AddIndexToApidaeTowns (20180218094339)
|
232
|
+
[1m[35m (0.4ms)[0m [1m[35mBEGIN[0m
|
233
|
+
[1m[35m (0.2ms)[0m [1m[31mROLLBACK[0m
|
234
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT pg_advisory_unlock(6140174353533887940)[0m
|
235
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT pg_try_advisory_lock(6140174353533887940)[0m
|
236
|
+
[1m[35m (0.9ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
237
|
+
Migrating to ChangeTextColumnsToJson (20180218172704)
|
238
|
+
[1m[35m (0.1ms)[0m [1m[35mBEGIN[0m
|
239
|
+
[1m[35m (0.8ms)[0m [1m[35mALTER TABLE "apidae_objects" ALTER COLUMN "pictures_data" TYPE jsonb USING CAST(value AS JSON)[0m
|
240
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
241
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT pg_advisory_unlock(6140174353533887940)[0m
|
242
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT pg_try_advisory_lock(6140174353533887940)[0m
|
243
|
+
[1m[35m (0.5ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
244
|
+
Migrating to ChangeTextColumnsToJson (20180218172704)
|
245
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
246
|
+
[1m[35m (0.7ms)[0m [1m[35mALTER TABLE "apidae_objects" ALTER COLUMN "pictures_data" TYPE jsonb USING CAST(pictures_data AS JSON)[0m
|
247
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
248
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT pg_advisory_unlock(6140174353533887940)[0m
|
249
|
+
[1m[35m (0.1ms)[0m [1m[34mSELECT pg_try_advisory_lock(6140174353533887940)[0m
|
250
|
+
[1m[35m (0.8ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
251
|
+
Migrating to ChangeTextColumnsToJson (20180218172704)
|
252
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
253
|
+
[1m[35m (0.8ms)[0m [1m[35mALTER TABLE "apidae_objects" ALTER COLUMN "pictures_data" TYPE jsonb USING pictures_data::JSON[0m
|
254
|
+
[1m[35m (0.1ms)[0m [1m[31mROLLBACK[0m
|
255
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT pg_advisory_unlock(6140174353533887940)[0m
|
256
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT pg_try_advisory_lock(6140174353533887940)[0m
|
257
|
+
[1m[35m (0.5ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
258
|
+
Migrating to ChangeTextColumnsToJson (20180218172704)
|
259
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
260
|
+
[1m[35m (8.5ms)[0m [1m[35mALTER TABLE "apidae_objects" ALTER COLUMN "pictures_data" TYPE jsonb USING pictures_data::text::jsonb[0m
|
261
|
+
[1m[35m (2.4ms)[0m [1m[35mALTER TABLE "apidae_objects" ALTER COLUMN "type_data" TYPE jsonb USING type_data::text::jsonb[0m
|
262
|
+
[1m[35m (4.0ms)[0m [1m[35mALTER TABLE "apidae_objects" ALTER COLUMN "entity_data" TYPE jsonb USING entity_data::text::jsonb[0m
|
263
|
+
[1m[35m (2.8ms)[0m [1m[35mALTER TABLE "apidae_objects" ALTER COLUMN "contact" TYPE jsonb USING contact::text::jsonb[0m
|
264
|
+
[1m[35m (2.9ms)[0m [1m[35mALTER TABLE "apidae_objects" ALTER COLUMN "address" TYPE jsonb USING address::text::jsonb[0m
|
265
|
+
[1m[35m (3.1ms)[0m [1m[35mALTER TABLE "apidae_objects" ALTER COLUMN "openings" TYPE jsonb USING openings::text::jsonb[0m
|
266
|
+
[1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version"[0m [["version", "20180218172704"]]
|
267
|
+
[1m[35m (3.6ms)[0m [1m[35mCOMMIT[0m
|
268
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.7ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2[0m [["key", "environment"], ["LIMIT", 1]]
|
269
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
270
|
+
[1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "key"[0m [["key", "environment"], ["value", "development"], ["created_at", "2018-02-18 17:35:13.592426"], ["updated_at", "2018-02-18 17:35:13.592426"]]
|
271
|
+
[1m[35m (0.3ms)[0m [1m[35mCOMMIT[0m
|
272
|
+
[1m[35m (0.2ms)[0m [1m[34mSELECT pg_advisory_unlock(6140174353533887940)[0m
|
273
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
274
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT pg_try_advisory_lock(6140174353533887940)[0m
|
275
|
+
[1m[35m (1.0ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
276
|
+
Migrating to AddServiceDataToApidaeObjects (20180218231319)
|
277
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
278
|
+
[1m[35m (0.9ms)[0m [1m[35mALTER TABLE "apidae_objects" ADD "service_data" jsonb[0m
|
279
|
+
[1m[35mSQL (0.4ms)[0m [1m[32mINSERT INTO "schema_migrations" ("version") VALUES ($1) RETURNING "version"[0m [["version", "20180218231319"]]
|
280
|
+
[1m[35m (5.5ms)[0m [1m[35mCOMMIT[0m
|
281
|
+
[1m[36mActiveRecord::InternalMetadata Load (7.7ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2[0m [["key", "environment"], ["LIMIT", 1]]
|
282
|
+
[1m[35m (0.2ms)[0m [1m[35mBEGIN[0m
|
283
|
+
[1m[35m (0.1ms)[0m [1m[35mCOMMIT[0m
|
284
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT pg_advisory_unlock(6140174353533887940)[0m
|
285
|
+
[1m[35m (0.3ms)[0m [1m[34mSELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC[0m
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apidae
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean-Baptiste Vilain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -89,11 +89,13 @@ files:
|
|
89
89
|
- app/helpers/apidae/import_helper.rb
|
90
90
|
- app/helpers/apidae/objects_helper.rb
|
91
91
|
- app/helpers/apidae/selections_helper.rb
|
92
|
+
- app/models/apidae/application_record.rb
|
92
93
|
- app/models/apidae/attached_file.rb
|
93
94
|
- app/models/apidae/export.rb
|
94
95
|
- app/models/apidae/file_import.rb
|
95
96
|
- app/models/apidae/object.rb
|
96
97
|
- app/models/apidae/selection.rb
|
98
|
+
- app/models/apidae/selection_object.rb
|
97
99
|
- app/models/apidae/town.rb
|
98
100
|
- app/views/apidae/dashboard/index.html.erb
|
99
101
|
- app/views/apidae/import/callback.html.erb
|
@@ -120,6 +122,9 @@ files:
|
|
120
122
|
- db/migrate/20170720161134_add_entity_data_to_objects.rb
|
121
123
|
- db/migrate/20170730102424_create_apidae_file_imports.rb
|
122
124
|
- db/migrate/20171025075304_create_apidae_exports.rb
|
125
|
+
- db/migrate/20180217222410_create_apidae_selection_objects.rb
|
126
|
+
- db/migrate/20180218172704_change_text_columns_to_json.rb
|
127
|
+
- db/migrate/20180218231319_add_service_data_to_apidae_objects.rb
|
123
128
|
- lib/apidae.rb
|
124
129
|
- lib/apidae/engine.rb
|
125
130
|
- lib/apidae/version.rb
|
@@ -176,6 +181,7 @@ files:
|
|
176
181
|
- test/fixtures/apidae/attached_files.yml
|
177
182
|
- test/fixtures/apidae/exports.yml
|
178
183
|
- test/fixtures/apidae/objects.yml
|
184
|
+
- test/fixtures/apidae/selection_objects.yml
|
179
185
|
- test/fixtures/apidae/selections.yml
|
180
186
|
- test/fixtures/apidae/towns.yml
|
181
187
|
- test/integration/navigation_test.rb
|
@@ -183,6 +189,7 @@ files:
|
|
183
189
|
- test/models/apidae/export_test.rb
|
184
190
|
- test/models/apidae/file_import_test.rb
|
185
191
|
- test/models/apidae/object_test.rb
|
192
|
+
- test/models/apidae/selection_object_test.rb
|
186
193
|
- test/models/apidae/selection_test.rb
|
187
194
|
- test/models/apidae/town_test.rb
|
188
195
|
- test/test_helper.rb
|
@@ -206,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
213
|
version: '0'
|
207
214
|
requirements: []
|
208
215
|
rubyforge_project:
|
209
|
-
rubygems_version: 2.
|
216
|
+
rubygems_version: 2.5.1
|
210
217
|
signing_key:
|
211
218
|
specification_version: 4
|
212
219
|
summary: A Ruby on Rails engine for projects that involve Apidae data
|
@@ -251,11 +258,13 @@ test_files:
|
|
251
258
|
- test/dummy/README.rdoc
|
252
259
|
- test/integration/navigation_test.rb
|
253
260
|
- test/models/apidae/object_test.rb
|
261
|
+
- test/models/apidae/selection_object_test.rb
|
254
262
|
- test/models/apidae/selection_test.rb
|
255
263
|
- test/models/apidae/file_import_test.rb
|
256
264
|
- test/models/apidae/export_test.rb
|
257
265
|
- test/models/apidae/attached_file_test.rb
|
258
266
|
- test/models/apidae/town_test.rb
|
267
|
+
- test/fixtures/apidae/selection_objects.yml
|
259
268
|
- test/fixtures/apidae/towns.yml
|
260
269
|
- test/fixtures/apidae/objects.yml
|
261
270
|
- test/fixtures/apidae/selections.yml
|