input-many : class_name method not found
Reported by Arnaud D. | October 2nd, 2010 @ 09:41 PM | in Hobo 1.3 (Rails 3)
Hi,
it seems that in rails 3, class_name is not defined anymore, but
is used in input-many tag.
As a solution, we can add this file:
config/initializers/class_name.rb
module ActiveRecord class Base class << self # Turns a +table_name+ into a class name. Singularise the table name, if # table names are pluralised; then camelise. This follows the basic # technique used by the +initialize+ method at # activerecord-3.0.0.rc/lib/active_record/fixtures.rb:543. def class_name(table_name = self.table_name) (ActiveRecord::Base.pluralize_table_names ? table_name.singularize : table_name).camelize end end end end
Maybe it can be added while creating a new hobo application.
I'm not sure it can be considered as a rails 3 bug :/
Regards,
Arnaud.
Comments and changes to this ticket
-
Domizio Demichelis October 5th, 2010 @ 02:37 PM
- State changed from new to open
- Milestone set to Hobo 1.3 (Rails 3)
- Assigned user set to Domizio Demichelis
- Milestone order changed from 197903 to 0
-
Domizio Demichelis October 5th, 2010 @ 11:11 PM
- Milestone order changed from 21 to 0
It's a 2 years long story: https://rails.lighthouseapp.com/projects/8994/tickets/379-activerec...
I think we should avoid to use it in Hobo. It seems safe to change it with 'name' in the input-many tag, but there are other places where we are using it, and I have to see how to change it.
-
Domizio Demichelis October 9th, 2010 @ 02:56 PM
partially fixed in cbb183a315d1b3b128ee95eafb78a24970a999fa (for the input-many tag) but hobo uses that in other places, so the ticket is still open
-
Domizio Demichelis October 9th, 2010 @ 11:59 PM
- State changed from open to resolved
the class_name used elsewhere in hobo is not the same method removed from AR::Base
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »