2012-08-11 10:52:12 -04:00
|
|
|
require 'action_view/record_identifier'
|
|
|
|
|
|
|
|
module ActionController
|
2012-08-25 07:40:56 -04:00
|
|
|
module RecordIdentifier
|
2013-01-16 19:55:02 -05:00
|
|
|
MODULE_MESSAGE = 'Calling ActionController::RecordIdentifier.%s is deprecated and ' \
|
|
|
|
'will be removed in Rails 4.1, please call using ActionView::RecordIdentifier instead.'
|
|
|
|
INSTANCE_MESSAGE = '%s method will no longer be included by default in controllers ' \
|
|
|
|
'since Rails 4.1. If you would like to use it in controllers, please include ' \
|
|
|
|
'ActionView::RecordIdentifier module.'
|
2012-08-25 07:40:56 -04:00
|
|
|
|
|
|
|
def dom_id(record, prefix = nil)
|
2013-01-16 19:55:02 -05:00
|
|
|
ActiveSupport::Deprecation.warn(INSTANCE_MESSAGE % 'dom_id')
|
2012-08-25 07:40:56 -04:00
|
|
|
ActionView::RecordIdentifier.dom_id(record, prefix)
|
|
|
|
end
|
|
|
|
|
|
|
|
def dom_class(record, prefix = nil)
|
2013-01-16 19:55:02 -05:00
|
|
|
ActiveSupport::Deprecation.warn(INSTANCE_MESSAGE % 'dom_class')
|
|
|
|
ActionView::RecordIdentifier.dom_class(record, prefix)
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.dom_id(record, prefix = nil)
|
|
|
|
ActiveSupport::Deprecation.warn(MODULE_MESSAGE % 'dom_id')
|
|
|
|
ActionView::RecordIdentifier.dom_id(record, prefix)
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.dom_class(record, prefix = nil)
|
|
|
|
ActiveSupport::Deprecation.warn(MODULE_MESSAGE % 'dom_class')
|
2012-08-25 07:40:56 -04:00
|
|
|
ActionView::RecordIdentifier.dom_class(record, prefix)
|
|
|
|
end
|
|
|
|
end
|
2012-08-11 10:52:12 -04:00
|
|
|
end
|