Permalink
Browse files

böses eval entfernt

  • Loading branch information...
1 parent 747cd86 commit bf6b8066ba7842e9630bf02471a522f18f36fb69 Timo Göllner committed Feb 10, 2012
Showing with 4 additions and 5 deletions.
  1. +4 −5 lib/has_images.rb
View
@@ -23,11 +23,6 @@ def has_images(options={})
has_attached_file :file, options
belongs_to :parentmodel, :polymorphic => true, :counter_cache => counter_cache
})
- eval %Q{
- def digineo_image_class
- Digineo::Image::#{self.name}
- end
- }
belongs_to :parentmodel, :polymorphic => true, :counter_cache => counter_cache
has_many :images, :as => :parentmodel, :dependent => :destroy, :order => 'id ASC', :class_name => "Digineo::Image::#{self.name}"
@@ -45,6 +40,10 @@ def digineo_image_class
alias_method_chain :avatar=, :autobuild
end
+
+ def digineo_image_class
+ ::Digineo::Image.const_get(self.name)
+ end
end
module InstanceMethods

0 comments on commit bf6b806

Please sign in to comment.