20130815000001_update_geo2.rb 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. class UpdateGeo2 < ActiveRecord::Migration
  2. def up
  3. Setting.where( :name => 'geo_backend' ).destroy_all
  4. Setting.create_if_not_exists(
  5. :title => 'Geo Location Backend',
  6. :name => 'geo_location_backend',
  7. :area => 'System::Geo',
  8. :description => 'Defines the backend for geo location lookups.',
  9. :options => {
  10. :form => [
  11. {
  12. :display => '',
  13. :null => true,
  14. :name => 'geo_location_backend',
  15. :tag => 'select',
  16. :options => {
  17. '' => '-',
  18. 'GeoLocation::Gmaps' => 'Google Maps',
  19. },
  20. },
  21. ],
  22. },
  23. :state => 'GeoLocation::Gmaps',
  24. :frontend => false
  25. )
  26. Setting.create_if_not_exists(
  27. :title => 'Geo IP Backend',
  28. :name => 'geo_ip_backend',
  29. :area => 'System::Geo',
  30. :description => 'Defines the backend for geo ip lookups.',
  31. :options => {
  32. :form => [
  33. {
  34. :display => '',
  35. :null => true,
  36. :name => 'geo_ip_backend',
  37. :tag => 'select',
  38. :options => {
  39. '' => '-',
  40. 'GeoIp::Freegeoip' => 'freegeoip.net',
  41. },
  42. },
  43. ],
  44. },
  45. :state => 'GeoIp::Freegeoip',
  46. :frontend => false
  47. )
  48. end
  49. def down
  50. end
  51. end