lib/pupa/refinements/opencivicdata.rb in pupa-0.1.0 vs lib/pupa/refinements/opencivicdata.rb in pupa-0.1.1
- old
+ new
@@ -30,10 +30,10 @@
# instead of inheritance, or go back to `Pupa::Model` being a superclass instead
# of a mixin to take advantage of `DescendantsTracker` itself.
#
# Instead of adding a callback, we can override `to_h` when `persist` is `true`.
ObjectSpace.each_object(Class) do |base|
- if base.include?(Pupa::Model)
+ if base != Sequel::Model && base.include?(Pupa::Model) # Sequel::Model will error on #include?
base.class_eval do
set_callback(:save, :before) do |object|
object._type = object._type.camelize.demodulize.underscore
end
end