lib/evil/client/model.rb in evil-client-3.0.2 vs lib/evil/client/model.rb in evil-client-3.0.3
- old
+ new
@@ -79,10 +79,11 @@
# @param [Evil::Client::Model] other
# @return [self]
#
def extend(other)
return super if other.instance_of? Module
+
validate_model other
extend_model other
end
# Model instance constructor
@@ -107,9 +108,10 @@
I18n.available_locales = available_locales
end
def validate_model(other)
return if other.ancestors.include? Evil::Client::Model
+
raise TypeError, "#{other} is not a subclass of Evil::Client::Model"
end
def extend_model(other)
other.dry_initializer.options.each do |definition|