Skip to content

Upgrading rails version

David Corking edited this page Jul 26, 2013 · 12 revisions

From Rails 3.1 to 3.2

Run bundle install after checking out a Rails 3.2 version of LocalSupport. You may also need to run bundle exec rake db:migrate and bundle exec rake db:categories if your database isn't up to date.

Development branch dcorking:rails32

We ran bundle update after upgrading Rails in the Gemfile, which upgraded versions in Gemfile.lock. Then we checked Gemfile.lock into git.

We made small changes to the font-awesome code in app/assets/stylesheets/bootstrap_and_overrides.css.less to suit the upgrade from version 2.2.6 to 2.2.7 of the twitter-bootstrap-rails gem.

Cucumber / Minitest crash

Weird crash in minitest when running cucumber in Travis. See line 903 of Build275. Pull requests welcome.

Deprecation warnings while testing

Pull requests welcome to fix these.

Travis logged these warnings in Build 275

DEPRECATION WARNING: Calling set_table_name is deprecated. Please 
use `self.table_name = 'the_name'`    instead. (called from <class:CategoryOrganization> at 
/home/travis/build/tansaku/LocalSupport/app/models/category_organization.rb:2)

app/models/category_organization.rb

RSpec stub! is deprecated - use stub

RSpec mock is deprecated - use double

vendor/plugins deprecation warnings while deploying to Heroku

vendor/plugins is deprecated in Rails 3.2, and does not work in Rails 4.

LocalSupport doesn't use vendor plugins but Heroku does, in Rails 3. https://gist.github.com/mtc2013/6079095

When we upgraded to Rails 4.0, Heroku dealt automatically with the deprecation warnings

http://stackoverflow.com/a/9042604

https://devcenter.heroku.com/articles/rails4#upgrading-a-rails3-app

From 3.2 to 4.0

Run bundle install after checking out a Rails 4.0 version of LocalSupport.

You may also need to run bundle exec rake db:migrate and bundle exec rake db:categories if your database isn't up to date.

Development branch mtc2013:rails40

As we did when upgrading to 3.2, we ran bundle update after upgrading Rails in the Gemfile, which upgraded versions in Gemfile.lock. We then checked Gemfile.lock into git.

Gmaps blank on first display

(https://github.com/apneadiving/Google-Maps-for-Rails/issues/357)

Mass assignment protection

protected_attributes gem or strong parameters protection model? (gem not supported after 4.0)

(http://weblog.rubyonrails.org/2012/3/21/strong-parameters/) (http://edgeapi.rubyonrails.org/classes/ActionController/StrongParameters.html)

Gmaps4Rails and Google Maps

Sometimes, the Google Map does not render on first visit to the home page. Some errors show in the browser javascript console. How can we make this failure repeatable?

[7:58:54 PM] Michael: (https://github.com/apneadiving/Google-Maps-for-Rails/issues/357) [7:59:38 PM] Michael: maybe theres a javascript error [8:02:53 PM] Michael: Uncaught ReferenceError: Gmaps is not defined [8:03:00 PM] Michael: Uncaught Error: Sprockets::FileNotFound: couldn't find file 'twitter/bootstrap' (in /app/app/assets/javascripts/application.js:9)

Is it TurboLinks?

Turbolinks is enabled by default in new apps, but is rumoured to cause some Javascript rendering problems on upgraded apps. http://guides.rubyonrails.org/working_with_javascript_in_rails.html#turbolinks

HTTP verb constraint

http://guides.rubyonrails.org/routing.html#http-verb-constraints