File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -50,20 +50,16 @@ def self.inherited(base)
50
50
51
51
def self . attributes ( *attrs )
52
52
attrs = attrs . first if attrs . first . class == Array
53
- _attributes . concat ( attrs )
54
- _attributes . uniq!
55
53
56
54
attrs . each do |attr |
57
- define_method attr do
58
- object && object . read_attribute_for_serialization ( attr )
59
- end unless method_defined? ( attr ) || _fragmented . respond_to? ( attr )
55
+ attribute ( attr )
60
56
end
61
57
end
62
58
63
59
def self . attribute ( attr , options = { } )
64
60
key = options . fetch ( :key , attr )
65
- self . _attributes_keys [ attr ] = { key : key } if key != attr
66
- self . _attributes << key unless _attributes . include? ( key )
61
+ _attributes_keys [ attr ] = { key : key } if key != attr
62
+ _attributes << key unless _attributes . include? ( key )
67
63
68
64
ActiveModelSerializers . silence_warnings do
69
65
define_method key do
You can’t perform that action at this time.
0 commit comments