Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
updated commit
  • Loading branch information
aashish committed Mar 14, 2018
commit c11da39d683b3ddfef3c0e8fece02eb70d518fb8
15 changes: 9 additions & 6 deletions lib/stringex/acts_as_url.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

require 'stringex/acts_as_url/adapter'
# encoding: UTF-8
require "stringex/acts_as_url/adapter"

module Stringex
module ActsAsUrl # :nodoc:
Expand Down Expand Up @@ -61,7 +61,9 @@ class << self

define_method :acts_as_url_configuration do
klass = self.class
klass = klass.superclass while klass.acts_as_url_configuration.nil?
while klass.acts_as_url_configuration.nil?
klass = klass.superclass
end
klass.acts_as_url_configuration
end
end
Expand All @@ -72,6 +74,7 @@ class << self
acts_as_url_configuration.adapter.create_callbacks! self
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 = nil, &block)
Expand All @@ -94,9 +97,9 @@ def initialize_urls
acts_as_url_configuration.adapter.initialize_urls! self
end

# Renitialize the url fields for the all records. Designed for people who want to update
# <tt>acts_as_url</tt> support once there's already development/production data they'd
# like to keep around.
# Renitialize the url fields for the all records. Designed for people who
# want to update <tt>acts_as_url</tt> support once there's already
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace detected.

# development/production data they'd like to keep around.
def reinitialize_urls
acts_as_url_configuration.adapter.reinitialize_urls! self
end
Expand Down