SlideShare uma empresa Scribd logo
1 de 23
Baixar para ler offline
Upgrading to Rails 3
About Me
•              a.k.a “xdite”
    •   http://blog.xdite.net

    •   http://plurk.com/xdite

    •   http://github.com/xdite

• Ruby on Rails Developer since 2007
• Rails Developer of HTC
Rails 3
http://weblog.rubyonrails.org/2008/12/23/merb-gets-merged-into-rails-3
It’s a big bang rewrite ...
What will change?
see ihower’s slide!
Basis
• ActiveRecord Query API
• ActiveRecord Validation API
• View: XSS
• View: Javascript
• Routing
• Bundler
Upgrade is dangerous
But !
rails3
         [*****]   XDXD
            6/09   3:33:08 ihower
Cost: 3h4m
Prerequisites

• Test Coverage
• Rails 1.8.7 and Rails 3
• RackEnv ( using Passenger )
• git remote branch
• Strong Heart and Excellent Ruby Skill.
What will you face? (major)

• Query API change.
• HTML auto Escape
• Routing Changes
• Unobtrusive Javascript
• Plugin Broken ( internal API Channges )
What can you do? ( major)
• use Rails Best Practice.
• writing tests
• move config.gem to Gemfile
• move rjs to unobtrusive javascripts.
• organize the same logic in HTML to helpers.
• replacing plugin to gem.
• survey plugin for rails3 ( railsplugins.org)
Rails Best Practices
• Move code from Controller to Model
• Extract into Module
• Never logic code in Views
• Organize Helper files
STEP
• install rails3
• modified httpd for RackEnv
• git branch rails3
• run rails-upgrade check, and document it.
• backup files ( route.rb, application.rb ... )
• rails new .
• run test, and fix. till finish......
Normally, you will fail...
Because...
• Not writing test (!!!)
• Writing model logic in views.(!!!)
  •   Post.find(:all).map{ |c| [c.name, c.id] }

• Copy & Paste anywhere(!!!)
  •   broken everywhere based on the same thing

• Fixing bug and refactoring project in the
  same time.(!!!!!!!!!!!!!)
prepare well before starting
Resources

• The Rails 3 Upgrade Handbook
• Bundler
• RailsPlugins.org
• The Lowdown on Routes in Rails.
• Unobtrusive Javascript in Rails 3
We are hiring!!
         xdite_cheng@htc.com

Mais conteúdo relacionado

Mais procurados

Python simillar image search
Python simillar image searchPython simillar image search
Python simillar image searchJernej Virag
 
RoR 101: Session 1
RoR 101: Session 1RoR 101: Session 1
RoR 101: Session 1Rory Gianni
 
Quick dive into Ruby on Rails
Quick dive into Ruby on RailsQuick dive into Ruby on Rails
Quick dive into Ruby on RailsHosam Aly
 
From rest api to graph ql a 10 year journey
From rest api to graph ql a 10 year journeyFrom rest api to graph ql a 10 year journey
From rest api to graph ql a 10 year journeyArno Schulz
 
ruby + websocket + haproxy
ruby + websocket + haproxyruby + websocket + haproxy
ruby + websocket + haproxyMathieu Elie
 
Rails I18n From The Trenches
Rails I18n From The TrenchesRails I18n From The Trenches
Rails I18n From The Trenchesclemensk
 
Task queuing with redis and rq
Task queuing with redis and rqTask queuing with redis and rq
Task queuing with redis and rqndeininger
 
TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)Igor Talevski
 
java8-patterns
java8-patternsjava8-patterns
java8-patternsJustin Lin
 
Moving Web forward: Part I — ECMAScript 201x
Moving Web forward: Part I — ECMAScript 201xMoving Web forward: Part I — ECMAScript 201x
Moving Web forward: Part I — ECMAScript 201xSergey Rubanov
 
Next generation testing
Next generation testingNext generation testing
Next generation testingStephen Erdman
 
Before you jump into Angular
Before you jump into AngularBefore you jump into Angular
Before you jump into AngularM A Hossain Tonu
 
Introduction to Scala for Java Developers
Introduction to Scala for Java DevelopersIntroduction to Scala for Java Developers
Introduction to Scala for Java DevelopersSolix JJ
 
Perf onjs final
Perf onjs finalPerf onjs final
Perf onjs finalqi yang
 
Rails automatic test driven development
Rails automatic test driven developmentRails automatic test driven development
Rails automatic test driven developmenttyler4long
 
Custom Mongrel Handlers: Learning how to walk the dog
Custom Mongrel Handlers: Learning how to walk the dogCustom Mongrel Handlers: Learning how to walk the dog
Custom Mongrel Handlers: Learning how to walk the dogEzra Zygmuntowicz
 
ruby on rails development company in india
ruby on rails development company in indiaruby on rails development company in india
ruby on rails development company in indiaSAG IPL
 
Pharo: A Reflective System
Pharo: A Reflective SystemPharo: A Reflective System
Pharo: A Reflective SystemMarcus Denker
 

Mais procurados (20)

Python simillar image search
Python simillar image searchPython simillar image search
Python simillar image search
 
RoR 101: Session 1
RoR 101: Session 1RoR 101: Session 1
RoR 101: Session 1
 
Quick dive into Ruby on Rails
Quick dive into Ruby on RailsQuick dive into Ruby on Rails
Quick dive into Ruby on Rails
 
From rest api to graph ql a 10 year journey
From rest api to graph ql a 10 year journeyFrom rest api to graph ql a 10 year journey
From rest api to graph ql a 10 year journey
 
ruby + websocket + haproxy
ruby + websocket + haproxyruby + websocket + haproxy
ruby + websocket + haproxy
 
Javascript Workshop
Javascript WorkshopJavascript Workshop
Javascript Workshop
 
Rails I18n From The Trenches
Rails I18n From The TrenchesRails I18n From The Trenches
Rails I18n From The Trenches
 
Task queuing with redis and rq
Task queuing with redis and rqTask queuing with redis and rq
Task queuing with redis and rq
 
TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)
 
java8-patterns
java8-patternsjava8-patterns
java8-patterns
 
Moving Web forward: Part I — ECMAScript 201x
Moving Web forward: Part I — ECMAScript 201xMoving Web forward: Part I — ECMAScript 201x
Moving Web forward: Part I — ECMAScript 201x
 
Next generation testing
Next generation testingNext generation testing
Next generation testing
 
Before you jump into Angular
Before you jump into AngularBefore you jump into Angular
Before you jump into Angular
 
Introduction to Scala for Java Developers
Introduction to Scala for Java DevelopersIntroduction to Scala for Java Developers
Introduction to Scala for Java Developers
 
Perf onjs final
Perf onjs finalPerf onjs final
Perf onjs final
 
Merb tutorial
Merb tutorialMerb tutorial
Merb tutorial
 
Rails automatic test driven development
Rails automatic test driven developmentRails automatic test driven development
Rails automatic test driven development
 
Custom Mongrel Handlers: Learning how to walk the dog
Custom Mongrel Handlers: Learning how to walk the dogCustom Mongrel Handlers: Learning how to walk the dog
Custom Mongrel Handlers: Learning how to walk the dog
 
ruby on rails development company in india
ruby on rails development company in indiaruby on rails development company in india
ruby on rails development company in india
 
Pharo: A Reflective System
Pharo: A Reflective SystemPharo: A Reflective System
Pharo: A Reflective System
 

Destaque (18)

Ec2onrails
Ec2onrailsEc2onrails
Ec2onrails
 
Pp6-xdite
Pp6-xditePp6-xdite
Pp6-xdite
 
Intro to Rails Workshop ( TA 須知 )
Intro to Rails Workshop ( TA 須知 )Intro to Rails Workshop ( TA 須知 )
Intro to Rails Workshop ( TA 須知 )
 
From The Christmas Heart
From The  Christmas  HeartFrom The  Christmas  Heart
From The Christmas Heart
 
Los Niños no Olvidan. Parte 4
Los Niños no Olvidan. Parte 4Los Niños no Olvidan. Parte 4
Los Niños no Olvidan. Parte 4
 
OSDC 2009 Rails Turtorial
OSDC 2009 Rails TurtorialOSDC 2009 Rails Turtorial
OSDC 2009 Rails Turtorial
 
Los Niños no Olvidan. Parte 5
Los Niños no Olvidan. Parte 5 Los Niños no Olvidan. Parte 5
Los Niños no Olvidan. Parte 5
 
Presenter's tools: Software & Hardware
Presenter's tools: Software & HardwarePresenter's tools: Software & Hardware
Presenter's tools: Software & Hardware
 
Very Xd
Very XdVery Xd
Very Xd
 
Understanding Stem Cells
Understanding Stem CellsUnderstanding Stem Cells
Understanding Stem Cells
 
2016 01 07-part2
2016 01 07-part22016 01 07-part2
2016 01 07-part2
 
Plastic Surgery of a Presentation
Plastic Surgery of a PresentationPlastic Surgery of a Presentation
Plastic Surgery of a Presentation
 
2016 01 07 part 1
2016 01 07 part 12016 01 07 part 1
2016 01 07 part 1
 
Numbers You Did'nt Know on Cell Phones
Numbers You Did'nt Know on Cell PhonesNumbers You Did'nt Know on Cell Phones
Numbers You Did'nt Know on Cell Phones
 
2016 01 09 NPS - 63
2016 01 09 NPS - 632016 01 09 NPS - 63
2016 01 09 NPS - 63
 
Animal timing. Animal rights
Animal timing. Animal rightsAnimal timing. Animal rights
Animal timing. Animal rights
 
The Real History Of Christmas
The Real History Of ChristmasThe Real History Of Christmas
The Real History Of Christmas
 
Cell Phone and Driving Funny and Seriously
Cell Phone and Driving Funny and SeriouslyCell Phone and Driving Funny and Seriously
Cell Phone and Driving Funny and Seriously
 

Semelhante a Upgrading to rails3

Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Wen-Tien Chang
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and ActivatorKevin Webber
 
Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3Jukka Zitting
 
Rapid development with Rails
Rapid development with RailsRapid development with Rails
Rapid development with RailsYi-Ting Cheng
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails_zaMmer_
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails_zaMmer_
 
OrigoDB - take the red pill
OrigoDB - take the red pillOrigoDB - take the red pill
OrigoDB - take the red pillRobert Friberg
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Henry S
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Nilesh Panchal
 
RSpec on Rails Tutorial
RSpec on Rails TutorialRSpec on Rails Tutorial
RSpec on Rails TutorialWen-Tien Chang
 
UPenn on Rails intro
UPenn on Rails introUPenn on Rails intro
UPenn on Rails introMat Schaffer
 
React on rails v6.1 at LA Ruby, November 2016
React on rails v6.1 at LA Ruby, November 2016React on rails v6.1 at LA Ruby, November 2016
React on rails v6.1 at LA Ruby, November 2016Justin Gordon
 
Ractor's speed is not light-speed
Ractor's speed is not light-speedRactor's speed is not light-speed
Ractor's speed is not light-speedSATOSHI TAGOMORI
 
Scala at Treasure Data
Scala at Treasure DataScala at Treasure Data
Scala at Treasure DataTaro L. Saito
 
[.Net开发交流会][2010.06.19]better framework better life(吕国宁)
[.Net开发交流会][2010.06.19]better framework better life(吕国宁)[.Net开发交流会][2010.06.19]better framework better life(吕国宁)
[.Net开发交流会][2010.06.19]better framework better life(吕国宁)Shanda innovation institute
 

Semelhante a Upgrading to rails3 (20)

Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and Activator
 
遇見 Ruby on Rails
遇見 Ruby on Rails遇見 Ruby on Rails
遇見 Ruby on Rails
 
Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3
 
Rapid development with Rails
Rapid development with RailsRapid development with Rails
Rapid development with Rails
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
 
Jasig rubyon rails
Jasig rubyon railsJasig rubyon rails
Jasig rubyon rails
 
OrigoDB - take the red pill
OrigoDB - take the red pillOrigoDB - take the red pill
OrigoDB - take the red pill
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
 
Rails 3.1
Rails 3.1Rails 3.1
Rails 3.1
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
 
RSpec on Rails Tutorial
RSpec on Rails TutorialRSpec on Rails Tutorial
RSpec on Rails Tutorial
 
UPenn on Rails intro
UPenn on Rails introUPenn on Rails intro
UPenn on Rails intro
 
React on rails v6.1 at LA Ruby, November 2016
React on rails v6.1 at LA Ruby, November 2016React on rails v6.1 at LA Ruby, November 2016
React on rails v6.1 at LA Ruby, November 2016
 
Ractor's speed is not light-speed
Ractor's speed is not light-speedRactor's speed is not light-speed
Ractor's speed is not light-speed
 
Impression of Rails 3
Impression of Rails 3Impression of Rails 3
Impression of Rails 3
 
Rack
RackRack
Rack
 
Scala at Treasure Data
Scala at Treasure DataScala at Treasure Data
Scala at Treasure Data
 
[.Net开发交流会][2010.06.19]better framework better life(吕国宁)
[.Net开发交流会][2010.06.19]better framework better life(吕国宁)[.Net开发交流会][2010.06.19]better framework better life(吕国宁)
[.Net开发交流会][2010.06.19]better framework better life(吕国宁)
 

Mais de Yi-Ting Cheng

莫拉克颱風災情支援網
莫拉克颱風災情支援網莫拉克颱風災情支援網
莫拉克颱風災情支援網Yi-Ting Cheng
 
Ship It ! with Ruby/ Rails Ecosystem
Ship It ! with Ruby/ Rails EcosystemShip It ! with Ruby/ Rails Ecosystem
Ship It ! with Ruby/ Rails EcosystemYi-Ting Cheng
 
Scaling Rails Sites by default
Scaling Rails Sites by defaultScaling Rails Sites by default
Scaling Rails Sites by defaultYi-Ting Cheng
 
Sinatra Introduction
Sinatra IntroductionSinatra Introduction
Sinatra IntroductionYi-Ting Cheng
 

Mais de Yi-Ting Cheng (9)

農家樂 Agricola
農家樂 Agricola農家樂 Agricola
農家樂 Agricola
 
莫拉克颱風災情支援網
莫拉克颱風災情支援網莫拉克颱風災情支援網
莫拉克颱風災情支援網
 
Ship It ! with Ruby/ Rails Ecosystem
Ship It ! with Ruby/ Rails EcosystemShip It ! with Ruby/ Rails Ecosystem
Ship It ! with Ruby/ Rails Ecosystem
 
Scaling Rails Sites by default
Scaling Rails Sites by defaultScaling Rails Sites by default
Scaling Rails Sites by default
 
Sinatra Introduction
Sinatra IntroductionSinatra Introduction
Sinatra Introduction
 
Rails21v2
Rails21v2Rails21v2
Rails21v2
 
Very Xd Hw9
Very Xd Hw9Very Xd Hw9
Very Xd Hw9
 
Happyweb8 Encode
Happyweb8 EncodeHappyweb8 Encode
Happyweb8 Encode
 
Happyweb8 Encode
Happyweb8 EncodeHappyweb8 Encode
Happyweb8 Encode
 

Upgrading to rails3