lib/coactive/initializers/contexts.rb in coactive-0.2.1 vs lib/coactive/initializers/contexts.rb in coactive-0.2.2

- old
+ new

@@ -12,10 +12,11 @@ self._contexts = [] end class_methods do def context(*names, **options) - self._contexts = self._contexts + names.map { |name| Variable.new(name, options) } + self._contexts = _contexts.reject { |var| names.include?(var.name) } + self._contexts += names.map { |name| Variable.new(name, options) } end end end end end