Skip to content

Commit 6ce2b79

Browse files
authored
* use Alba inflector (#3)
1 parent ecf16fd commit 6ce2b79

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

app/serializers/application_serializer.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,6 @@ class ApplicationSerializer
33
include Alba::Resource
44
include Typelizer::DSL
55

6-
class << self
7-
def one(name, serializer: nil, **options)
8-
options[:resource] ||= serializer || "#{name}Serializer".classify.constantize
9-
super(name, **options)
10-
end
11-
12-
def many(name, serializer: nil, **options)
13-
options[:resource] ||= serializer || "#{name.to_s.singularize}Serializer".classify.constantize
14-
super(name, **options)
15-
end
16-
end
17-
186
private
197

208
def default_url_options = ActiveStorage::Current.url_options

config/initializers/alba.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Alba.inflector = :active_support

0 commit comments

Comments
 (0)