- https://www.ombulabs.com/blog/rails/tips-for-upgrading-rails-3-2-to-4.html
- https://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-3-2-to-rails-4-0
- https://github.com/alindeman/upgradingtorails4
- https://github.com/alindeman/rails4_upgrade
- https://thomasleecopeland.com/2015/08/06/running-rails-update.html
- https://mensfeld.pl/2013/06/upgrading-to-rails-4-0-from-rails-3-2-test-case-part-i-preparations-configuration-gems/
- https://www.ombulabs.com/blog/rails/upgrades/upgrade-rails-from-3-2-to-4-0.html
- https://www.webascender.com/blog/crucial-steps-when-upgrading-an-application-from-rails-3-to-rails-4/
- http://www.rails-upgrade-checklist.com/#4.0
- http://blog.barbershoplabs.com/blog/2013/02/27/upgrading-from-rails-32-to-rails-40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def blocks_double_render_error | |
@books = Book.all | |
render 'index' and return | |
render 'show' | |
@books.last.update_column(:title, 'Or am I?') | |
end | |
#=> Rendering books/index.html.haml within layouts/application | |
#=> Book.last.title | |
#=> "Surprise Surprise" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sets up APPLICATION_NAME_HERE and deploys to Heroku. This should be run while on master | |
# NOTE: if you get a permission denied error, try running `chmod u+x bin/deploy` in the terminal | |
# Fails script if any commands fail | |
set -e | |
echo '== Installing dependencies ==' | |
bundle install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Current < ActiveSupport::CurrentAttributes | |
attribute :account, :user | |
attribute :request_id, :user_agent, :ip_address | |
resets { Time.zone = nil } | |
def user=(user) | |
super | |
self.account = user.account | |
Time.zone = user.time_zone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AttributesApiExample < ApplicationRecord | |
attribute :start_date, :date, default: -> { 1.day.from_now } | |
attribute :end_date, :date, default: -> { 8.days.from_now } | |
attribute :my_attribute, :my_type, default: -> { 'My Default Value' } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enumerable's Detect | |
# - returns first element for which block returns true and then stops. If none returns nil. | |
(1..100).detect { |i| i % 5 == 0 and i % 7 == 0 } #=> 35 | |
# Find All | |
(1..10).find_all { |i| i % 3 == 0 } #=> [3, 6, 9] | |
# Reject |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# bash < <(curl -s https://gist.githubusercontent.com/fantactuka/3228898/raw/f0806a64306426ca72f16734ae7cd16c1f84bd87/update-chrome-driver.sh) | |
echo "Updating Chrome Driver" | |
sudo su | |
if [ -e /usr/bin/chromedriver ]; then | |
rm /usr/bin/chromedriver | |
echo "Removing current Chrome Driver from /usr/bin" |
I hereby claim:
- I am schwad on github.
- I am schwad (https://keybase.io/schwad) on keybase.
- I have a public key whose fingerprint is 3C9A 6DC1 2573 C25F BE23 22FF AB00 9D50 E34A E076
To claim this, I am signing this object:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Tesla | |
module Truck | |
module Destroyer | |
def self.call(human_name:) | |
puts "Das #{human_name} wurde zerstört." | |
end | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NilClass | |
def method_missing(method, *args) | |
<<~EOAA | |
Somebody once told me the world is gonna roll me | |
I ain't the sharpest tool in the shed | |
She was looking kind of dumb with her finger and her thumb | |
In the shape of an "L" on her forehead | |
Well, the years start coming and they don't stop coming | |
Fed to the rules and I hit the ground running | |
Didn't make sense not to live for fun |