Skip to content

Instantly share code, notes, and snippets.

@railsbridge
Created July 22, 2009 00:11
Show Gist options
  • Save railsbridge/151713 to your computer and use it in GitHub Desktop.
Save railsbridge/151713 to your computer and use it in GitHub Desktop.
if belong_tos.size > 0
belong_tos = belong_tos.delete_if {|x| x == "#{@polymorphic}, " }
if belong_tos.size > 0
last_in_array_fix = belong_tos.last
last_in_array_fix = last_in_array_fix.gsub(', ','')
belong_tos.pop
belong_tos << last_in_array_fix
schema << " - belongs_to: [#{belong_tos}]\n"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment