Upload
wei-yi-chiu
View
23
Download
0
Embed Size (px)
Citation preview
HOW TO UPGRADE RORFROM RAILS 3 TO RAILS 4
ei-Yi, Chiu - 2016/11/18
OUTLINE
introduction
tutorial
Incompatibilities
gem upgradation
INTRODUCTION
HIGHLIGHT IN RAILS 4.0
Ruby 2.0 preferred; 1.9.3 required
Strong Parameters
Turbolinks
Russian Doll Caching
STRONG PARAMETERS
mass-assignment
attr_accessible / attr_protected
MVC
TURNOLINKS
Turbolinks for Rails (like pjax)
pjax:
turbolinks:
data-no-turbolink
RUSSIAN DOLL CACHING
viewcache
updated_atkey => touch
HIGHLIGHT IN RAILS 4.1
Spring application preloader
config/secets.yml
Action Pack variants
Action Mailer previews
Active Record enums
SPRING / SECRETS.YML
Spring
rails apprakerails
config/secret.yml
secret
ACTION PACK VARIANTS
ACTION MAILER PREVIEWS
ACTION MAILER PREVIEWS
HIGHLIGHT IN RAILS 4.2
Adequate Record(2x)find_by
Web Console
Active Job
Asynchronous mails
Foreign key support
ACTIVE JOB
queuing system
ACTION MAILER
deliver!
deliver_now / deliver_later
FOREIGN KEY SUPPORT
FOREIGN KEY SUPPORT
TUTORIAL
TUTORIAL
rvm install ruby-2.2.1
localhost: 2.2.1
server: 2.1.9
rails app:update
use rails:update on 4.2 and earlier
bundle update
rails 4doccode...
INCOMPATIBILITIES
INCOMPATIBILITIES IN RAILS 4.0
Strong parameters
default using dalli in ActiveSupport::Cache::MemCacheStore.
Model.all now returns an ActiveRecord::Relation
INCOMPATIBILITIES IN RAILS 4.0
INCOMPATIBILITIES IN RAILS 4.1
String#remove(pattern) as String#gsub(pattern,')
Added Time.zone.yesterday and Time.zone.tomorrow.
INCOMPATIBILITIES IN RAILS 4.2
render foo/bar" => render template: foo/bar
respond_with and the corresponding class-level respond_to have been moved to the responders gem.
Default Host for rails server
The *_filter family of methods have been removed from the documentation. Their usage is discouraged in favor of the *_action family of methods:
https://github.com/plataformatec/responders
GEM UPGRADATION
UNINTIALIZED CONTENT ARE:SQLITERAL
cache_storedallidallirails 4cache
rails4/dalliarelSqliteral
cache
memcache
GOOGLE DOC
google docsession
rails4google-api-clientGoogle::APIClient::JWTAsserter
GOOGLE DOC
RENDER JSON
Rails 3 Rails 4
END