Rails
Rails4

rails4.0.0.beta1 -> rails4.0.0.rc1 migration guide

More than 5 years have passed since last update.

今のところ、これ以外わからん。


config/initializers/session_store.rb

diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb

index e3f861f..b7cac75 100644
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -1,3 +1,3 @@
# Be sure to restart your server when you modify this file.

-HogeCo::Application.config.session_store :encrypted_cookie_store, key: '_hoge_co_session'
+HogeCo::Application.config.session_store :cookie_store, key: '_hoge_co_session'

encrypted_cookie_store てのが無くなったぽい。

@see https://github.com/rails/rails/pull/9978


error log

gems/railties-4.0.0.rc1/lib/rails/application/configuration.rb:144:in `const_get': uninitialized constant ActionDispatch::Session::EncryptedCookieStore (NameError)


config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb

diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb

index 33725e9..ddd9dd5 100644
--- a/config/initializers/wrap_parameters.rb
+++ b/config/initializers/wrap_parameters.rb
@@ -9,6 +9,6 @@ ActiveSupport.on_load(:action_controller) do
end

# To enable root element in JSON for ActiveRecord objects.
-# ActiveSupport.on_load(:active_record) do
-# self.include_root_in_json = true
-# end
+ActiveSupport.on_load(:active_record) do
+ self.include_root_in_json = true
+end

もしくは、

@post.to_json で ['post'] を期待したコードを排除する

@see https://github.com/rails/rails/issues/9459

@see https://github.com/rails/rails/commit/8c7d4018e0ddec462075027defb3575c47952c3e


layout nil はデフォルトレイアウトを返すようになった

xhr経由でレイアウト出さないような処理

  layout Proc.new { |controller| controller.request.xhr? ? false : 'application' }

てな感じで、layout false に変更

@see https://github.com/rails/rails/commit/ef27bba63d93453dee26e2decfca80659f2da735#actionpack/lib/abstract_controller/layouts.rb