13
13
# transformation formats.
14
14
#
15
15
module Blacklight ::Document
16
+ autoload :ActiveModelShim , 'blacklight/document/active_model_shim'
16
17
autoload :SchemaOrg , 'blacklight/document/schema_org'
17
18
autoload :DublinCore , 'blacklight/document/dublin_core'
18
19
autoload :Email , 'blacklight/document/email'
@@ -42,14 +43,6 @@ def initialize(source_doc={}, response=nil)
42
43
apply_extensions
43
44
end
44
45
45
- def to_model
46
- self
47
- end
48
-
49
- def persisted?
50
- true
51
- end
52
-
53
46
# the wrapper method to the @_source object.
54
47
# If a method is missing, it gets sent to @_source
55
48
# with all of the original params and block
@@ -65,14 +58,6 @@ def respond_to_missing? *args
65
58
_source_responds_to? ( *args ) || super
66
59
end
67
60
68
- def [] *args
69
- _source . send :[] , *args
70
- end
71
-
72
- def _read_attribute ( attr )
73
- self [ attr ]
74
- end
75
-
76
61
# Helper method to check if value/multi-values exist for a given key.
77
62
# The value can be a string, or a RegExp
78
63
# Multiple "values" can be given; only one needs to match.
@@ -138,30 +123,10 @@ def first key
138
123
Array ( self [ key ] ) . first
139
124
end
140
125
141
- def id
142
- self [ self . class . unique_key ]
143
- end
144
-
145
- def to_param
146
- id . to_s
147
- end
148
-
149
- def as_json ( options = nil )
150
- _source . as_json ( options )
151
- end
152
-
153
126
def to_partial_path
154
127
'catalog/document'
155
128
end
156
129
157
- def destroyed?
158
- false
159
- end
160
-
161
- def new_record?
162
- false
163
- end
164
-
165
130
def has_highlight_field? k
166
131
false
167
132
end
@@ -186,13 +151,6 @@ def unique_key
186
151
@unique_key ||= 'id'
187
152
end
188
153
189
- def primary_key
190
- unique_key
191
- end
192
-
193
- def base_class
194
- self
195
- end
196
154
end
197
155
198
156
private
0 commit comments