mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Add a deprecation DSL
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
require 'active_model_serializers/adapter/attributes'
|
||||
|
||||
module ActiveModel
|
||||
class Serializer
|
||||
module Adapter
|
||||
class Attributes < DelegateClass(ActiveModelSerializers::Adapter::Attributes)
|
||||
def initialize(serializer, options = {})
|
||||
warn "Calling deprecated #{self.class.name} (#{__FILE__}) from #{caller[0..2].join(', ')}. Please use #{self.class.name.sub('ActiveModel::Serializer', 'ActiveModelSerializers')}"
|
||||
super(ActiveModelSerializers::Adapter::Attributes.new(serializer, options))
|
||||
end
|
||||
class << self
|
||||
extend ActiveModelSerializers::Deprecate
|
||||
deprecate :new, 'ActiveModelSerializers::Adapter::Json.'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user