Skip to content

Commit c757609

Browse files
committed
Fix tests
1 parent e406c18 commit c757609

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

gems/active_model_serializers/0.10/_test/test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
module Test
44
class Article < ActiveModelSerializers::Model
5+
# @dynamic title, title=, body, body=, tags, tags=, initialize
56
attributes :title, :body, :tags
67
end
78

89
class Tag < ActiveModelSerializers::Model
10+
# @dynamic name, name=, initialize
911
attributes :name
1012
end
1113

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,19 @@
11
module Test
22
class Article < ActiveModelSerializers::Model
3-
module GeneratedAttributeMethods
4-
attr_accessor title: String
5-
attr_accessor body: String
6-
attr_accessor tags: Array[Tag]
3+
attr_accessor title: String
4+
attr_accessor body: String
5+
attr_accessor tags: Array[Tag]
76

8-
def initialize: (title: String, body: String, tags: Array[Tag]) -> void
9-
end
10-
include GeneratedAttributeMethods
7+
def initialize: (title: String, body: String, tags: Array[Tag]) -> void
118
end
129

1310
class Tag < ActiveModelSerializers::Model
14-
module GeneratedAttributeMethods
15-
attr_accessor name: String
11+
attr_accessor name: String
1612

17-
def initialize: (name: String) -> void
18-
end
19-
include GeneratedAttributeMethods
13+
def initialize: (name: String) -> void
2014
end
2115

22-
class ArticleSerializer < ActiveModel::Serializer
23-
module GeneratdMethods
24-
attr_accessor object: Article
25-
end
26-
include GeneratdMethods
16+
class ArticleSerializer < ActiveModel::Serializer[Article]
2717
def tag_names: () -> Array[String]
2818
end
2919
end

0 commit comments

Comments
 (0)