Skip to content

Instantly share code, notes, and snippets.

@sleungcy
Created March 9, 2016 00:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sleungcy/fc5ab5546bc60fd88c1d to your computer and use it in GitHub Desktop.
Save sleungcy/fc5ab5546bc60fd88c1d to your computer and use it in GitHub Desktop.
Rails question
class User < ActiveRecord::Base
def test
puts "#{user_name.blank?}" # outputs false
if false
user_name = "this_should_never_run"
end
puts "#{user_name.blank?}" # outputs true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment