phil.h.smith
2010-Mar-20 09:05 UTC
[PATCH] AR migration generator includes model''s modules in table name. [#4230]
Hello! Could someone review the patch attached to [1] and provide feedback? Briefly, it targets rails 3, and fixes "rails g model admin/post". The generated migration creates a "admin_posts" table while the model expects a table simply named "posts". With the patch, the migration creates "posts". Thank you! --phil-- [1] https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4230 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
phil.h.smith
2010-Mar-20 23:59 UTC
Re: AR migration generator includes model''s modules in table name. [#4230]
I''ve added two alternative patches. The 2nd is a variation on the first that avoids introducing a new method in NamedBase. The 3rd leaves NamedBase completely alone, and instead adds ''self.table_name_prefix = "admin_"'' to generated models. On Mar 20, 2:05 am, "phil.h.smith" <phil.h.sm...@gmail.com> wrote:> Hello! Could someone review the patch attached to [1] and provide > feedback? > > Briefly, it targets rails 3, and fixes "rails g model admin/post". > The generated migration creates a "admin_posts" table while the model > expects a table simply named "posts". With the patch, the migration > creates "posts". > > Thank you! > --phil-- > > [1]https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4230-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.