Skip to content

Instantly share code, notes, and snippets.

Boot Error
Something went wrong while loading /Users/alfonsouceda/code/projects/ruby/bookshelf/config.ru
Hanami::Model::Error: undefined method `call' for nil:NilClass Did you mean? caller
/Users/alfonsouceda/.gem/ruby/2.3.3/bundler/gems/model-8024bf39be21/lib/hanami/model.rb:88:in `rescue in load!'
/Users/alfonsouceda/.gem/ruby/2.3.3/bundler/gems/model-8024bf39be21/lib/hanami/model.rb:76:in `load!'
/Users/alfonsouceda/.gem/ruby/2.3.3/bundler/gems/hanami-42b63074f2bb/lib/hanami/components/components.rb:57:in `block (2 levels) in <module:Components>'
/Users/alfonsouceda/.gem/ruby/2.3.3/bundler/gems/hanami-42b63074f2bb/lib/hanami/components/component.rb:42:in `call'
@AlfonsoUceda
AlfonsoUceda / rails4.md
Last active November 18, 2016 07:35
Rails 4 here we go!

Rails 4 here we go!

Why we need Rails 4? Why is it nicer? No! well it is but that isn't the key. Our two main reasons are security and performance. I've been researching our current situation to migrate Rails 3.2 to Rails 4.0.13 and Paco has been done a lot of things.

He created two branches paco/rails4-compat and paco/rail4, the first one is a branch with changes needed in rails 4 but they are compatibles with rails 3 to make easier the upgrade, the latter has the minimum changes needed to upgrade to rails 4.

One solution to upgrade rails 4, it could be deploy to master when everything is fine in local and test passing, I mean, check in production mode in localhost and test the main points of the application.

I've created two PRs for both branches, first we need to merge paco/rails4-compat in master (and stable) and finally merge paco/rails4 in master and leave there one week or so. I explain in those PRs how should be updated because they are sync with stable so there aren't problems related

require 'progressbar'
schedulings = Company.find_by_name("SPT").schedulings.preloads_for_indexing
@progress = ProgressBar.new('Processing schedulings', schedulings.count)
start_now = Time.now
puts "Started at: #{start_now}"
schedulings.find_each do |scheduling|
Scheduling.__elasticsearch__.client.update(
index: Scheduling.index_name,