diff options
| author | Alban Peignier | 2012-07-05 18:40:41 +0200 |
|---|---|---|
| committer | Alban Peignier | 2012-07-05 18:40:41 +0200 |
| commit | ab123be8d9f909b46de5e0f049eb49a8f4c6183c (patch) | |
| tree | 003732873304ed073614248c5ab763e80309926d | |
| parent | 34cb941725dd15aecb5906f674a196574577567b (diff) | |
| download | chouette-core-ab123be8d9f909b46de5e0f049eb49a8f4c6183c.tar.bz2 | |
Upgrade Rails to 3.2.6. Refs #91
| -rw-r--r-- | Gemfile | 11 | ||||
| -rw-r--r-- | Gemfile.lock | 117 | ||||
| -rw-r--r-- | app/controllers/stop_areas_controller.rb | 3 | ||||
| -rw-r--r-- | app/models/export.rb | 5 | ||||
| -rw-r--r-- | app/models/import.rb | 8 | ||||
| -rw-r--r-- | app/models/referential.rb | 2 | ||||
| -rw-r--r-- | config/database.yml | 2 | ||||
| -rw-r--r-- | config/environments/development.rb | 4 | ||||
| -rw-r--r-- | config/environments/test.rb | 3 | ||||
| -rw-r--r-- | db/schema.rb | 29 | ||||
| -rw-r--r-- | lib/tasks/assets.rake | 4 | ||||
| -rw-r--r-- | lib/tasks/warbler.rake | 7 | ||||
| -rw-r--r-- | spec/models/export_spec.rb | 1 | ||||
| -rw-r--r-- | spec/models/import_spec.rb | 4 |
14 files changed, 91 insertions, 109 deletions
@@ -1,6 +1,6 @@ source 'http://rubygems.org' -gem 'rails', '3.1.3' +gem 'rails', '3.2.6' gem 'devise' gem "ffi-proj4", :git => 'git://github.com/dryade/ffi-proj4.git' @@ -22,8 +22,7 @@ end gem "map_layers", "~> 0.0.4" gem "georuby-ext", :git => 'git://github.com/dryade/georuby-ext.git' -#gem 'user_interface', :git => 'git://github.com/dryade/user-interface.git' -gem 'user_interface', :git => 'git://sim.dryade.priv/user_interface' +gem 'user_interface', :git => 'git://sim.dryade.priv/user_interface' #, :path => '~/Projects/UserInterfaceDryade' gem 'json' gem 'cocoon' gem 'formtastic' @@ -39,15 +38,15 @@ gem "acts_as_tree", :git => "git://github.com/dryade/acts_as_tree.git" gem 'ninoxe', :git => 'git://chouette.dryade.priv/ninoxe' #, :path => '~/Projects/Ninoxe' gem 'acts_as_list', '0.1.6' -gem 'composite_primary_keys', '4.1.2' +#gem 'composite_primary_keys', '~> 5.0.8' gem 'delayed_job_active_record' gem 'apartment',:git => 'git://github.com/dryade/apartment.git' # Gems used only for assets and not required # in production environments by default. group :assets do - gem 'sass-rails', '= 3.1.4' - gem 'coffee-rails', '~> 3.1.1' + gem 'sass-rails', '~> 3.2.3' + gem 'coffee-rails', '~> 3.2.1' gem 'coffee-script-source' gem 'uglifier', '>= 1.0.3' gem 'therubyrhino', :platform => :jruby diff --git a/Gemfile.lock b/Gemfile.lock index 562e905ec..60277beeb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,14 +1,14 @@ GIT remote: git://chouette.dryade.priv/ninoxe - revision: a8067d3063e01019d6599489781eb6ec4415890c + revision: 49ca25a1cb40534346e5d439144fdaae4a13dc21 specs: ninoxe (0.0.8) GeoRuby - activerecord (~> 3.1.3) + activerecord (> 3.1.3) acts_as_list (= 0.1.6) - composite_primary_keys (= 4.1.2) + composite_primary_keys (> 4.1.2) geokit - rails (= 3.1.3) + rails (> 3.1.3) GIT remote: git://github.com/dnagir/database_cleaner.git @@ -69,10 +69,10 @@ GIT GIT remote: git://sim.dryade.priv/user_interface - revision: 5302812852d2bd28ae29e49bc0d64a3bfb61fbc9 + revision: 6931e642037ffef9d3818669a5f5167a0298b30b specs: user_interface (0.0.1) - rails (~> 3.1.0) + rails (> 3.1.0) GEM remote: http://rubygems.org/ @@ -81,40 +81,39 @@ GEM RedCloth (4.2.9) RedCloth (4.2.9-java) SyslogLogger (1.4.1) - actionmailer (3.1.3) - actionpack (= 3.1.3) - mail (~> 2.3.0) - actionpack (3.1.3) - activemodel (= 3.1.3) - activesupport (= 3.1.3) + actionmailer (3.2.6) + actionpack (= 3.2.6) + mail (~> 2.4.4) + actionpack (3.2.6) + activemodel (= 3.2.6) + activesupport (= 3.2.6) builder (~> 3.0.0) erubis (~> 2.7.0) - i18n (~> 0.6) - rack (~> 1.3.5) - rack-cache (~> 1.1) - rack-mount (~> 0.8.2) + journey (~> 1.0.1) + rack (~> 1.4.0) + rack-cache (~> 1.2) rack-test (~> 0.6.1) - sprockets (~> 2.0.3) - activemodel (3.1.3) - activesupport (= 3.1.3) + sprockets (~> 2.1.3) + activemodel (3.2.6) + activesupport (= 3.2.6) builder (~> 3.0.0) - i18n (~> 0.6) - activerecord (3.1.3) - activemodel (= 3.1.3) - activesupport (= 3.1.3) - arel (~> 2.2.1) + activerecord (3.2.6) + activemodel (= 3.2.6) + activesupport (= 3.2.6) + arel (~> 3.0.2) tzinfo (~> 0.3.29) activerecord-jdbcsqlite3-adapter (1.2.1) activerecord-jdbc-adapter (~> 1.2.1) jdbc-sqlite3 (~> 3.7.2) - activeresource (3.1.3) - activemodel (= 3.1.3) - activesupport (= 3.1.3) - activesupport (3.1.3) + activeresource (3.2.6) + activemodel (= 3.2.6) + activesupport (= 3.2.6) + activesupport (3.2.6) + i18n (~> 0.6) multi_json (~> 1.0) acts_as_list (0.1.6) addressable (2.2.8) - arel (2.2.3) + arel (3.0.2) bcrypt-ruby (3.0.1) bcrypt-ruby (3.0.1-java) bouncy-castle-java (1.5.0146.1) @@ -137,15 +136,15 @@ GEM childprocess (0.3.2) ffi (~> 1.0.6) cocoon (1.0.22) - coffee-rails (3.1.1) + coffee-rails (3.2.2) coffee-script (>= 2.2.0) - railties (~> 3.1.0) + railties (~> 3.2.0) coffee-script (2.2.0) coffee-script-source execjs coffee-script-source (1.3.3) - composite_primary_keys (4.1.2) - activerecord (~> 3.1) + composite_primary_keys (5.0.8) + activerecord (~> 3.2.0) delayed_job (3.0.3) activesupport (~> 3.0) delayed_job_active_record (0.3.2) @@ -187,6 +186,7 @@ GEM has_scope (~> 0.5.0) responders (~> 0.6) jdbc-postgres (9.0.801) + journey (1.0.4) jquery-rails (1.0.19) railties (~> 3.0) thor (~> 0.14) @@ -212,7 +212,7 @@ GEM rb-fchange (~> 0.0.5) rb-fsevent (~> 0.9.1) rb-inotify (~> 0.8.8) - mail (2.3.3) + mail (2.4.4) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) @@ -234,30 +234,28 @@ GEM polyamorous (0.5.0) activerecord (~> 3.0) polyglot (0.3.3) - rack (1.3.6) + rack (1.4.1) rack-cache (1.2) rack (>= 0.4) - rack-mount (0.8.3) - rack (>= 1.0.0) rack-ssl (1.3.2) rack rack-test (0.6.1) rack (>= 1.0) - rails (3.1.3) - actionmailer (= 3.1.3) - actionpack (= 3.1.3) - activerecord (= 3.1.3) - activeresource (= 3.1.3) - activesupport (= 3.1.3) + rails (3.2.6) + actionmailer (= 3.2.6) + actionpack (= 3.2.6) + activerecord (= 3.2.6) + activeresource (= 3.2.6) + activesupport (= 3.2.6) bundler (~> 1.0) - railties (= 3.1.3) - railties (3.1.3) - actionpack (= 3.1.3) - activesupport (= 3.1.3) + railties (= 3.2.6) + railties (3.2.6) + actionpack (= 3.2.6) + activesupport (= 3.2.6) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) - thor (~> 0.14.6) + thor (>= 0.14.6, < 2.0) rake (0.9.2.2) ransack (0.6.0) actionpack (~> 3.0) @@ -296,13 +294,11 @@ GEM railties (>= 3.0) rspec (~> 2.10.0) rubyzip (0.9.8) - sass (3.1.19) - sass-rails (3.1.4) - actionpack (~> 3.1.0) - railties (~> 3.1.0) - sass (>= 3.1.4) - sprockets (~> 2.0.0) - tilt (~> 1.3.2) + sass (3.1.20) + sass-rails (3.2.5) + railties (~> 3.2.0) + sass (>= 3.1.10) + tilt (~> 1.3) selenium-webdriver (2.22.2) childprocess (>= 0.2.5) ffi (~> 1.0) @@ -313,7 +309,7 @@ GEM shoulda-matchers (1.1.0) activesupport (>= 3.0.0) spoon (0.0.1) - sprockets (2.0.4) + sprockets (2.1.3) hike (~> 1.2) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) @@ -325,7 +321,7 @@ GEM therubyracer (0.10.1) libv8 (~> 3.3.10) therubyrhino (1.73.4) - thor (0.14.6) + thor (0.15.4) tilt (1.3.3) treetop (1.4.10) polyglot @@ -361,9 +357,8 @@ DEPENDENCIES capistrano-ext capybara cocoon - coffee-rails (~> 3.1.1) + coffee-rails (~> 3.2.1) coffee-script-source - composite_primary_keys (= 4.1.2) database_cleaner! delayed_job_active_record devise @@ -383,13 +378,13 @@ DEPENDENCIES modernizr-rails (~> 2.0.6) ninoxe! pg (~> 0.11.0) - rails (= 3.1.3) + rails (= 3.2.6) ransack remarkable (~> 4.0.0.alpha4) remarkable_activerecord (~> 4.0.0.alpha4) rspec rspec-rails - sass-rails (= 3.1.4) + sass-rails (~> 3.2.3) shoulda! sqlite3 squeel diff --git a/app/controllers/stop_areas_controller.rb b/app/controllers/stop_areas_controller.rb index 71fa602cc..8d68fd1d5 100644 --- a/app/controllers/stop_areas_controller.rb +++ b/app/controllers/stop_areas_controller.rb @@ -68,9 +68,6 @@ class StopAreasController < ChouetteController alias_method :stop_area, :resource def map - ENV.each do |key, value| - Rails.logger.info "ENV['#{key}'] = '#{value}'" - end @map = StopAreaMap.new(stop_area).with_helpers(self) end diff --git a/app/models/export.rb b/app/models/export.rb index 401541a13..a83d89958 100644 --- a/app/models/export.rb +++ b/app/models/export.rb @@ -25,10 +25,6 @@ class Export < ActiveRecord::Base exporter ||= ::Chouette::Exporter.new(referential.slug) end - def options - read_attribute(:options) || write_attribute(:options, {}) - end - @@root = "#{Rails.root}/tmp/exports" cattr_accessor :root @@ -63,6 +59,7 @@ class Export < ActiveRecord::Base before_validation :define_default_attributes, :on => :create def define_default_attributes self.status ||= "pending" + self.options ||= {} end after_create :delayed_export diff --git a/app/models/import.rb b/app/models/import.rb index 662fe4a84..db59b41ac 100644 --- a/app/models/import.rb +++ b/app/models/import.rb @@ -17,18 +17,14 @@ class Import < ActiveRecord::Base name = name.to_s define_method(name) do - self.options[name] + self.options and self.options[name] end define_method("#{name}=") do |prefix| - self.options[name] = prefix + (self.options ||= {})[name] = prefix end end - def options - read_attribute(:options) || write_attribute(:options, {}) - end - def self.types # if Rails.env.development? and subclasses.blank? # Dir[File.expand_path("../*_import.rb", __FILE__)].each do |f| diff --git a/app/models/referential.rb b/app/models/referential.rb index 639e4de12..35d4e9141 100644 --- a/app/models/referential.rb +++ b/app/models/referential.rb @@ -68,7 +68,7 @@ end Rails.application.config.after_initialize do Chouette::ActiveRecord - puts "patch Chouette::ActiveRecord (#{__FILE__})" + class Chouette::ActiveRecord def referential diff --git a/config/database.yml b/config/database.yml index 599c581da..0c5c4ba6e 100644 --- a/config/database.yml +++ b/config/database.yml @@ -22,7 +22,7 @@ test: password: chouette production: - adapter: jdbcpostgresql + adapter: <%= RUBY_PLATFORM == "java" ? "jdbcpostgresql" : "postgresql" %> database: chouette2 encoding: utf8 host: localhost diff --git a/config/environments/development.rb b/config/environments/development.rb index 73606fc10..f4936039b 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -28,6 +28,10 @@ ChouetteIhm::Application.configure do # Expands the lines which load the assets config.assets.debug = false + config.active_record.mass_assignment_sanitizer = :strict + + config.active_record.auto_explain_threshold_in_seconds = (RUBY_PLATFORM == "java" ? nil : 0.5) + config.action_mailer.default_url_options = { :host => 'localhost:3000' } config.to_prepare do diff --git a/config/environments/test.rb b/config/environments/test.rb index b2c29057b..2d2e45717 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -24,6 +24,9 @@ ChouetteIhm::Application.configure do # Disable request forgery protection in test environment config.action_controller.allow_forgery_protection = false +# Raise exception on mass assignment protection for Active Record models + config.active_record.mass_assignment_sanitizer = :strict + # Tell Action Mailer not to deliver emails to the real world. # The :test delivery method accumulates sent emails in the # ActionMailer::Base.deliveries array. diff --git a/db/schema.rb b/db/schema.rb index c9fbc3ec1..93b26a89f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -176,8 +176,6 @@ ActiveRecord::Schema.define(:version => 20120620081755) do t.integer "choice_code" end - add_index "facilities_features", ["facility_id"], :name => "idx_facility_id" - create_table "file_validation_log_messages", :force => true do |t| t.integer "file_validation_id" t.string "key" @@ -192,7 +190,7 @@ ActiveRecord::Schema.define(:version => 20120620081755) do create_table "file_validations", :force => true do |t| t.string "status" - t.string "options" + t.string "options", :limit => 2000 t.string "file_name" t.string "file_type" t.datetime "created_at" @@ -211,13 +209,10 @@ ActiveRecord::Schema.define(:version => 20120620081755) do add_index "group_of_lines", ["objectid"], :name => "group_of_lines_objectid_key", :unique => true create_table "group_of_lines_lines", :id => false, :force => true do |t| - t.integer "group_of_line_id", :limit => 8, :null => false - t.integer "line_id", :limit => 8, :null => false + t.integer "group_of_line_id", :limit => 8 + t.integer "line_id", :limit => 8 end - add_index "group_of_lines_lines", ["group_of_line_id"], :name => "idx_grli_gr" - add_index "group_of_lines_lines", ["line_id"], :name => "idx_grli_li" - create_table "import_log_messages", :force => true do |t| t.integer "import_id" t.string "key" @@ -259,11 +254,10 @@ ActiveRecord::Schema.define(:version => 20120620081755) do add_index "journey_patterns", ["objectid"], :name => "journey_patterns_objectid_key", :unique => true create_table "journey_patterns_stop_points", :id => false, :force => true do |t| - t.integer "journey_pattern_id", :limit => 8, :null => false - t.integer "stop_point_id", :limit => 8, :null => false + t.integer "journey_pattern_id", :limit => 8 + t.integer "stop_point_id", :limit => 8 end - add_index "journey_patterns_stop_points", ["journey_pattern_id"], :name => "idx_jpsp_jpid" add_index "journey_patterns_stop_points", ["journey_pattern_id"], :name => "index_journey_pattern_id_on_journey_patterns_stop_points" create_table "lines", :force => true do |t| @@ -281,7 +275,6 @@ ActiveRecord::Schema.define(:version => 20120620081755) do t.string "comment" t.boolean "mobility_restricted_suitability" t.integer "int_user_needs" - t.integer "ptnetwork_id", :limit => 8 end add_index "lines", ["objectid"], :name => "lines_objectid_key", :unique => true @@ -327,7 +320,6 @@ ActiveRecord::Schema.define(:version => 20120620081755) do t.datetime "updated_at" t.string "prefix" t.string "projection_type" - t.string "bounding_box", :limit => nil t.string "time_zone" end @@ -353,9 +345,6 @@ ActiveRecord::Schema.define(:version => 20120620081755) do t.integer "line_id", :limit => 8 end - add_index "routing_constraints_lines", ["line_id"], :name => "idx_rcli_li" - add_index "routing_constraints_lines", ["stop_area_id"], :name => "idx_rcli_st" - create_table "stop_areas", :force => true do |t| t.integer "parent_id", :limit => 8 t.string "objectid", :null => false @@ -442,8 +431,8 @@ ActiveRecord::Schema.define(:version => 20120620081755) do add_index "time_tables", ["objectid"], :name => "time_tables_objectid_key", :unique => true create_table "time_tables_vehicle_journeys", :id => false, :force => true do |t| - t.integer "time_table_id", :limit => 8, :null => false - t.integer "vehicle_journey_id", :limit => 8, :null => false + t.integer "time_table_id", :limit => 8 + t.integer "vehicle_journey_id", :limit => 8 end add_index "time_tables_vehicle_journeys", ["time_table_id"], :name => "index_time_tables_vehicle_journeys_on_time_table_id" @@ -477,12 +466,8 @@ ActiveRecord::Schema.define(:version => 20120620081755) do t.time "waiting_time" t.time "elapse_duration" t.time "headway_frequency" - t.integer "position", :limit => 8 - t.boolean "is_departure", :default => false - t.boolean "is_arrival", :default => false end - add_index "vehicle_journey_at_stops", ["stop_point_id"], :name => "index_vehicle_journey_at_stops_on_stop_point_id" add_index "vehicle_journey_at_stops", ["stop_point_id"], :name => "index_vehicle_journey_at_stops_on_stop_pointid" add_index "vehicle_journey_at_stops", ["vehicle_journey_id"], :name => "index_vehicle_journey_at_stops_on_vehicle_journey_id" diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake index 251348b9e..1147b52da 100644 --- a/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake @@ -1,6 +1,6 @@ namespace :assets do task :environment do - puts "Sprockets::Bootstrap workaround (#{__FILE__})" - Sprockets::Bootstrap.new(Rails.application).run if Rails.application.assets.paths.empty? + # puts "Sprockets::Bootstrap workaround (#{__FILE__})" + # Sprockets::Bootstrap.new(Rails.application).run if Rails.application.assets.paths.empty? end end diff --git a/lib/tasks/warbler.rake b/lib/tasks/warbler.rake index 11aa26155..e69457583 100644 --- a/lib/tasks/warbler.rake +++ b/lib/tasks/warbler.rake @@ -1,7 +1,12 @@ begin require 'warbler' Warbler::Task.new - task :war => "assets:precompile" + + task "war:setup" do + ENV['RAILS_RELATIVE_URL_ROOT'] ||= "/chouette2" + end + + task :war => ["war:setup", "assets:precompile"] rescue LoadError => e puts "Failed to load Warbler. Make sure it's installed." end diff --git a/spec/models/export_spec.rb b/spec/models/export_spec.rb index 4e6a748ed..10fcf4b69 100644 --- a/spec/models/export_spec.rb +++ b/spec/models/export_spec.rb @@ -38,6 +38,7 @@ describe Export do describe "#options" do it "should be empty by default" do + puts subject.options.class subject.options.should be_empty end diff --git a/spec/models/import_spec.rb b/spec/models/import_spec.rb index f0a66eb4d..205489717 100644 --- a/spec/models/import_spec.rb +++ b/spec/models/import_spec.rb @@ -36,8 +36,8 @@ describe Import do describe "#options" do - it "should be empty by default" do - subject.options.should be_empty + it "should be nil by default" do + subject.options.should be_nil end end |
