Merge pull request #770 from dsander/fix-const-redefinition

Do not redfine LiquidDroppable classes

Akinori MUSHA 10 年 前
コミット
3bb7f7a06f
共有1 個のファイルを変更した1 個の追加1 個の削除を含む
  1. 1 1
      app/concerns/liquid_droppable.rb

+ 1 - 1
app/concerns/liquid_droppable.rb

@@ -21,7 +21,7 @@ module LiquidDroppable
21 21
   end
22 22
 
23 23
   included do
24
-    const_set :Drop, Kernel.const_set("#{name}Drop", Class.new(Drop))
24
+    const_set :Drop, Kernel.const_set("#{name}Drop", Class.new(Drop)) unless const_defined?("#{name}Drop")
25 25
   end
26 26
 
27 27
   def to_liquid