mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Add generators.
This seemed like the easiest place to start.
This commit is contained in:
8
lib/generators/serializer/templates/serializer.rb
Normal file
8
lib/generators/serializer/templates/serializer.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
<% module_namespacing do -%>
|
||||
class <%= class_name %>Serializer < <%= parent_class_name %>
|
||||
attributes <%= attributes_names.map(&:inspect).join(", ") %>
|
||||
end
|
||||
<% association_names.each do |attribute| -%>
|
||||
has_one :<%= attribute %>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
Reference in New Issue
Block a user