lib/administrate/field/base.rb in administrate-0.12.0 vs lib/administrate/field/base.rb in administrate-0.13.0
- old
+ new
@@ -14,22 +14,26 @@
def self.searchable?
false
end
+ def self.field_type
+ to_s.split("::").last.underscore
+ end
+
+ def self.permitted_attribute(attr, _options = nil)
+ attr
+ end
+
def initialize(attribute, data, page, options = {})
@attribute = attribute
@data = data
@page = page
@resource = options.delete(:resource)
@options = options
end
- def self.permitted_attribute(attr, _options = nil)
- attr
- end
-
def html_class
self.class.html_class
end
def name
@@ -38,17 +42,9 @@
def to_partial_path
"/fields/#{self.class.field_type}/#{page}"
end
- attr_reader :attribute, :data, :page, :resource
-
- protected
-
- attr_reader :options
-
- def self.field_type
- to_s.split("::").last.underscore
- end
+ attr_reader :attribute, :data, :options, :page, :resource
end
end
end