Skip to content

Commit

Permalink
Merge pull request #627 from binarylogic/depr_auth_many
Browse files Browse the repository at this point in the history
Deprecate authenticates_many
  • Loading branch information
jaredbeck committed Sep 21, 2018
2 parents 4752667 + 5380fc8 commit 7b178af
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/authlogic/authenticates_many/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ module Authlogic
module AuthenticatesMany
# These methods become class methods of ::ActiveRecord::Base.
module Base
DPR_AUTH_MANY = <<~EOS
authenticates_many is deprecated without replacement. Let us know
if you would like to take over maintenance of this feature as a separate
gem. If no one volunteers to extract and maintain a new gem, then this
feature will simply be deleted.
EOS

# Allows you to set up a relationship with your sessions. See module
# definition above for more details.
#
Expand Down Expand Up @@ -56,6 +63,7 @@ module Base
# `scope_cookies` is misleading. Perhaps simply `scope` or `scoped`
# would have been better.
def authenticates_many(name, options = {})
::ActiveSupport::Deprecation.warn(DPR_AUTH_MANY)
options[:session_class] ||= name.to_s.classify.constantize
options[:relationship_name] ||= options[:session_class].klass_name.underscore.pluralize
class_eval <<-EOS, __FILE__, __LINE__ + 1
Expand Down

0 comments on commit 7b178af

Please sign in to comment.