Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

user plain ruby instead of active support. sadly.

  • Loading branch information...
commit 5ccd1b69aa7cb43ae65c404374fe1df44d7eace5 1 parent 3bfd0f0
@rsl authored
Showing with 13 additions and 1 deletion.
  1. +13 −1 lib/stringex/acts_as_url.rb
View
14 lib/stringex/acts_as_url.rb
@@ -49,7 +49,19 @@ module ActsAsUrlClassMethods # :doc:
# include the characters needed to enforce uniqueness on duplicate urls.
# Default is nil.
def acts_as_url(attribute, options = {})
- cattr_accessor :acts_as_url_configuration
+ class_eval do
+ class << self
+ attr_accessor :acts_as_url_configuration
+ end
+
+ define_method :acts_as_url_configuration do
+ klass = self.class
+ while klass.acts_as_url_configuration.nil?
+ klass = klass.superclass
+ end
+ klass.acts_as_url_configuration
+ end
+ end
options[:attribute_to_urlify] = attribute
self.acts_as_url_configuration = Stringex::Configuration::ActsAsUrl.new(options)
Please sign in to comment.
Something went wrong with that request. Please try again.