-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
administrate.rb
45 lines (40 loc) · 1.43 KB
/
administrate.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
require "administrate/engine"
module Administrate
def self.warn_of_missing_resource_class
deprecator.warn(
"Calling Field::Base.permitted_attribute without the option " +
":resource_class is deprecated. If you are seeing this " +
"message, you are probably using a custom field type that" +
"does this. Please make sure to update it to a version that " +
"does not use a deprecated API",
)
end
def self.warn_of_deprecated_option(name)
deprecator.warn(
"The option :#{name} is deprecated. " +
"Administrate should detect it automatically. " +
"Please file an issue at " +
"https://github.com/thoughtbot/administrate/issues " +
"if you think otherwise.",
)
end
def self.warn_of_deprecated_method(klass, method)
deprecator.warn(
"The method #{klass}##{method} is deprecated. " +
"If you are seeing this message you are probably " +
"using a dashboard that depends explicitly on it. " +
"Please make sure you update it to a version that " +
"does not use a deprecated API",
)
end
def self.warn_of_deprecated_authorization_method(method)
deprecator.warn(
"The method `#{method}` is deprecated. " +
"Please use `accessible_action?` instead, " +
"or see the documentation for other options.",
)
end
def self.deprecator
@deprecator ||= ActiveSupport::Deprecation.new(VERSION, "Administrate")
end
end