Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH] Globalize2 broken in Rails 3.0 RC #35

Open
hipertracker opened this issue Jul 28, 2010 · 4 comments
Open

[PATCH] Globalize2 broken in Rails 3.0 RC #35

hipertracker opened this issue Jul 28, 2010 · 4 comments

Comments

@hipertracker
Copy link

In Rails 3.0RC methods "class_name" was removed from ActiveRecord::Base. Globalize2 is broken because of that (method "translates" does not work). Here is my short workaround (I just copy-pasted implementation of removed class_method into globalize/active_record.rb file)


# file  globalize2/lib/globalize/active_record.rb
# ...
# BEGIN OF PATCH
class_name = table_name[table_name_prefix.length..-(table_name_suffix.length + 1)].camelize
class_name = class_name.singularize if pluralize_table_names
# END OF PATCH
has_many :translations, :class_name  => translation_class.name,
                        :foreign_key => class_name.foreign_key,
                        :dependent   => :delete_all,
                        :extend      => HasManyExtensions
# ...
@hukl
Copy link
Collaborator

hukl commented Jul 29, 2010

i will look at that today - see if nothing else is broken - thanks for looing into it. You can accelerate things by forking, applying changes, writing / running tests and send pull requests by the way ;) - underrated concept!

@jcoyne
Copy link

jcoyne commented Aug 2, 2010

This patch fixes our issue. +1

@hukl
Copy link
Collaborator

hukl commented Aug 3, 2010

svenfuchs started a globalize3 repo which will be rails 3 compatible

@klebervirgilio
Copy link

Tks!
Solved my problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants