#3439 added new field and one-time storing of source into it

pull/4569/head
Kartones 9 years ago
parent 67778f0ed5
commit 79dc0bdaae

@ -61,7 +61,8 @@ class DataImport < Sequel::Model
# twitter_credits: Integer
# }
# No automatic conversion coded
'user_defined_limits'
'user_defined_limits',
'original_url'
]
# This attributes will get removed from public_values upon calling api_call_public_values
@ -246,6 +247,9 @@ class DataImport < Sequel::Model
self.values[:data_type] = TYPE_URL
self.values[:data_source] = data_source
end
self.original_url = self.values[:data_source] if (self.original_url.to_s.length == 0)
# else SQL-based import
end

@ -0,0 +1,13 @@
Sequel.migration do
up do
alter_table :data_imports do
add_column :original_url, :text, default: ''
end
end
down do
alter_table :data_imports do
drop_column :original_url
end
end
end

@ -21,6 +21,7 @@ describe Carto::Api::ImportsController do
end
after(:all) do
Resque.inline = false
@user.destroy
end

Loading…
Cancel
Save