lib/stringex/acts_as_url.rb in stringex-2.2.0 vs lib/stringex/acts_as_url.rb in stringex-2.2.1

- old
+ new

@@ -70,14 +70,16 @@ end # Some ORMs function as mixins not base classes and need to have a hook to reinclude # and re-extend ActsAsUrl methods - def included(base) + def included(base = nil, &block) super - base.send :include, Stringex::ActsAsUrl::ActsAsUrlInstanceMethods - base.send :extend, Stringex::ActsAsUrl::ActsAsUrlClassMethods + if base + base.send :include, Stringex::ActsAsUrl::ActsAsUrlInstanceMethods + base.send :extend, Stringex::ActsAsUrl::ActsAsUrlClassMethods + end end # Initialize the url fields for the records that need it. Designed for people who add # <tt>acts_as_url</tt> support once there's already development/production data they'd # like to keep around.