inconsistent set_table_name #3803

Closed
daniel2d2art opened this Issue Nov 30, 2011 · 2 comments

Comments

Projects
None yet
3 participants

If set_table_name specifies the same name but with diferent upper and lowercase combination don't use the epecified table_name continues with normalized rails table_name.
All in uppercase or different name, then accepts the assigment ...

Postgresql Table example named as "KaKaTua",

class Kakatua< ActiveRecord::Base
self.set_table_name "KaKaTua" # DON'T WORKS, sql ouputs as "kakatua". (need consistent set_table_name with "KaKaTua" sql output)
#self.set_table_name "KAKATUA" # WORKS, sql ouputs as "KAKATUA"
#self.set_table_name "KaKaxxxTua" # WORKS, ouputs as "KaKaxxxtua"

end

Member

steveklabnik commented Apr 30, 2012

Are you still seeing this issue on 3.2?

Seems to issue the right sql, tested with Rails 3.2.6:

class Kakatua < ActiveRecord::Base
  self.table_name = "KaKaTua"
end

>> Kakatua.table_name
=> "KaKaTua"
>> Kakatua.where('1=1').to_sql
=> "SELECT \"KaKaTua\".* FROM \"KaKaTua\"  WHERE (1=1)"

Given this test and the issue status, I'm going to close it for now. Please let us know if you still find this is an issue, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment