Skip to content

Instantly share code, notes, and snippets.

@fkumro
Created March 7, 2013 20:12
Show Gist options
  • Save fkumro/5111384 to your computer and use it in GitHub Desktop.
Save fkumro/5111384 to your computer and use it in GitHub Desktop.
NoMethodError at /users
undefined method `zero?' for nil:NilClass
27 def aliased_name_for(table_name, aliased_name = nil)
28 aliased_name ||= table_name
29
30 if aliases[table_name].zero?
31 # If it's zero, we can have our table_name
32 aliases[table_name] = 1
33 table_name
34 else
35 # Otherwise, we need to use an alias
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment