Merge branch 'master' of github.com:Vizzuality/cartodb

1.0
Javier Álvarez Medina 14 years ago
commit 0d72b04fde

@ -1,3 +1,5 @@
# coding: UTF-8
class Api::Json::TablesController < ApplicationController
skip_before_filter :verify_authenticity_token
@ -331,7 +333,7 @@ class Api::Json::TablesController < ApplicationController
protected
def load_table
@table = Table.select(:id,:user_id,:name,:privacy).filter(:id => params[:id]).first
@table = Table.select(:id,:user_id,:name,:privacy,:geometry_columns).filter(:id => params[:id]).first
raise RecordNotFound if @table.user_id != current_user.id
end

@ -43,6 +43,7 @@ table = Table.new :privacy => Table::PRIVATE, :name => 'Downloaded movies',
table.user_id = user.id
table.force_schema = "name varchar(255), address varchar(255), latitude float, longitude float"
table.save
table.set_lan_lon_columns!(:latitude, :longitude)
user.run_query("INSERT INTO #{table.name} (name, address, latitude, longitude) values ('#{String.random(15)}','Calle Santa Ana 1, 3C, Madrid',#{rand(100000).to_f / 100.0},#{rand(100000).to_f / 100.0})" )
user.run_query("INSERT INTO #{table.name} (name, address, latitude, longitude) values ('#{String.random(15)}','Calle Hortaleza 48, Madrid',#{rand(100000).to_f / 100.0},#{rand(100000).to_f / 100.0})" )

@ -1,3 +1,5 @@
# coding: UTF-8
require File.expand_path(File.dirname(__FILE__) + '/acceptance_helper')
feature "Tables" do

Loading…
Cancel
Save