Permalink
Browse files

--Adding Ole Begemann's <ole@oleb.net> patch to generator to fix assu…

…mption that all files in app/models are AR:Base descendandants
  • Loading branch information...
saimonmoore committed Apr 27, 2007
1 parent 0a9c090 commit 6b2630fa306b0b74e0c6dbff7e97ea79c0d8c14b
Showing with 1 addition and 1 deletion.
  1. +1 −1 generators/globalize/globalize_generator.rb
@@ -78,7 +78,7 @@ def generate_translated_model_migrations(langs)
Dir.glob("#{RAILS_ROOT}/app/models/*.rb").each do |f|
model = File.basename(f).gsub(File.extname(f),'').camelize.constantize rescue nil
- if model && model.base_class.superclass == ActiveRecord::Base
+ if model && model.respond_to?(:base_class) && model.base_class.superclass == ActiveRecord::Base
if model.keep_translations_in_model || Globalize::DbTranslate.keep_translations_in_model
key = "#{model.name}/#{model.table_name}"
attributes_for_migrations[key] = []

0 comments on commit 6b2630f

Please sign in to comment.