Merge pull request #3038 from MatheusMiranda/add_map_to_heading_page

Add map to sidebar on Heading's page
This commit is contained in:
Julian Nicolas Herrero
2018-12-11 16:32:35 +01:00
committed by GitHub
19 changed files with 380 additions and 24 deletions

View File

@@ -40,21 +40,31 @@ section "Creating Budgets" do
city_group = budget.groups.create!(name: I18n.t('seeds.budgets.groups.all_city'))
city_group.headings.create!(name: I18n.t('seeds.budgets.groups.all_city'),
price: 1000000,
population: 1000000)
population: 1000000,
latitude: '-40.123241',
longitude: '25.123249')
districts_group = budget.groups.create!(name: I18n.t('seeds.budgets.groups.districts'))
districts_group.headings.create!(name: I18n.t('seeds.geozones.north_district'),
price: rand(5..10) * 100000,
population: 350000)
population: 350000,
latitude: '15.234521',
longitude: '-15.234234')
districts_group.headings.create!(name: I18n.t('seeds.geozones.west_district'),
price: rand(5..10) * 100000,
population: 300000)
population: 300000,
latitude: '14.125125',
longitude: '65.123124')
districts_group.headings.create!(name: I18n.t('seeds.geozones.east_district'),
price: rand(5..10) * 100000,
population: 200000)
population: 200000,
latitude: '23.234234',
longitude: '-47.134124')
districts_group.headings.create!(name: I18n.t('seeds.geozones.central_district'),
price: rand(5..10) * 100000,
population: 150000)
population: 150000,
latitude: '-26.133213',
longitude: '-10.123231')
end
end

View File

@@ -0,0 +1,6 @@
class AddLocationToHeadings < ActiveRecord::Migration
def change
add_column :budget_headings, :latitude, :text
add_column :budget_headings, :longitude, :text
end
end

View File

@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20181016204729) do
ActiveRecord::Schema.define(version: 20181109111037) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -156,6 +156,8 @@ ActiveRecord::Schema.define(version: 20181016204729) do
t.integer "price", limit: 8
t.integer "population"
t.string "slug"
t.text "latitude"
t.text "longitude"
end
add_index "budget_headings", ["group_id"], name: "index_budget_headings_on_group_id", using: :btree