Another round of splash design
* Add map to splash * Reverse venue<->conference relation * Split venue address into fields * Don't go through venue for lodgings anymore
This commit is contained in:
parent
30e8ab856c
commit
cb227a0afc
55 changed files with 717 additions and 548 deletions
|
|
@ -20,6 +20,6 @@ class MoveBannerDescriptionToConference < ActiveRecord::Migration
|
|||
end
|
||||
end
|
||||
|
||||
remove_column :splashpages, :banner_description, :text
|
||||
remove_column :splashpages, :banner_description, :text
|
||||
end
|
||||
end
|
||||
|
|
|
|||
12
db/migrate/20141118143700_add_address_fields_to_venue.rb
Normal file
12
db/migrate/20141118143700_add_address_fields_to_venue.rb
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
class AddAddressFieldsToVenue < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :venues, :street, :string
|
||||
add_column :venues, :postalcode, :integer
|
||||
add_column :venues, :city, :string
|
||||
add_column :venues, :country, :string
|
||||
add_column :venues, :latitude, :string
|
||||
add_column :venues, :longitude, :string
|
||||
|
||||
remove_column :venues, :address, :text
|
||||
end
|
||||
end
|
||||
7
db/migrate/20141118150427_cleanup_venue.rb
Normal file
7
db/migrate/20141118150427_cleanup_venue.rb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
class CleanupVenue < ActiveRecord::Migration
|
||||
def change
|
||||
change_column :venues, :name, :string
|
||||
remove_column :venues, :offline_map_url, :string
|
||||
remove_column :venues, :offline_map_bounds, :string
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
class ChangeVenueConferenceAssociation < ActiveRecord::Migration
|
||||
class TempConference < ActiveRecord::Base
|
||||
self.table_name = 'conferences'
|
||||
end
|
||||
|
||||
class TempVenue < ActiveRecord::Base
|
||||
self.table_name = 'venues'
|
||||
attr_accessible :conference_id
|
||||
end
|
||||
|
||||
def change
|
||||
add_column :venues, :conference_id, :integer
|
||||
TempVenue.reset_column_information
|
||||
|
||||
# Change association from venue and conference
|
||||
TempConference.all.each do |conference|
|
||||
if TempVenue.exists?(id: conference.venue_id)
|
||||
venue = TempVenue.find_by(id: conference.venue_id)
|
||||
venue.update_attributes(conference_id: conference.id)
|
||||
end
|
||||
end
|
||||
|
||||
remove_column :conferences, :venue_id, :integer
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
class ChangeLodgingAssociationToConference < ActiveRecord::Migration
|
||||
class TempConference < ActiveRecord::Base
|
||||
self.table_name = 'conferences'
|
||||
end
|
||||
|
||||
class TempVenue < ActiveRecord::Base
|
||||
self.table_name = 'venues'
|
||||
end
|
||||
|
||||
class TempLodging < ActiveRecord::Base
|
||||
self.table_name = 'lodgings'
|
||||
attr_accessible :conference_id
|
||||
end
|
||||
|
||||
def change
|
||||
add_column :lodgings, :conference_id, :integer
|
||||
TempLodging.reset_column_information
|
||||
|
||||
# Change association from venue and conference
|
||||
TempConference.all.each do |conference|
|
||||
if TempVenue.exists?(conference_id: conference.id)
|
||||
venue = TempVenue.find_by(conference_id: conference.id)
|
||||
lodgings = TempLodging.where(venue_id: venue.id)
|
||||
lodgings.each do |lodging|
|
||||
lodging.update_attributes(conference_id: conference.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
remove_column :lodgings, :venue_id, :integer
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue