-
Notifications
You must be signed in to change notification settings - Fork 156
url data can be reinitialized #202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| # encoding: UTF-8 | ||
| require "stringex/acts_as_url/adapter" | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing magic comment # frozen_string_literal: true. |
||
| require 'stringex/acts_as_url/adapter' | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
|
|
||
| module Stringex | ||
| module ActsAsUrl # :nodoc: | ||
|
|
@@ -61,9 +61,7 @@ class << self | |
|
|
||
| define_method :acts_as_url_configuration do | ||
| klass = self.class | ||
| while klass.acts_as_url_configuration.nil? | ||
| klass = klass.superclass | ||
| end | ||
| klass = klass.superclass while klass.acts_as_url_configuration.nil? | ||
| klass.acts_as_url_configuration | ||
| end | ||
| end | ||
|
|
@@ -74,7 +72,6 @@ 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) | ||
|
|
@@ -97,9 +94,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 | ||
| # development/production data they'd like to keep around. | ||
| def reinitialize_urls | ||
| acts_as_url_configuration.adapter.reinitialize_urls! self | ||
| end | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing magic comment # frozen_string_literal: true.