Add a deprecation DSL

This commit is contained in:
Benjamin Fleischer
2016-03-07 01:03:04 -06:00
parent 6b4c8df6fb
commit b50195fde7
10 changed files with 91 additions and 31 deletions

View File

@@ -2,9 +2,9 @@ module ActiveModel
class Serializer
module Adapter
class Base < DelegateClass(ActiveModelSerializers::Adapter::Base)
def self.inherited(base)
warn "Inheriting deprecated ActiveModel::Serializer::Adapter::Base in #{caller[0..2].join(', ')}. Please use ActiveModelSerializers::Adapter::Base"
super
class << self
extend ActiveModelSerializers::Deprecate
deprecate :inherited, 'ActiveModelSerializers::Adapter::Base.'
end
def initialize(serializer, options = {})