aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators/rails/serializer/templates/serializer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/generators/rails/serializer/templates/serializer.rb')
-rw-r--r--railties/lib/rails/generators/rails/serializer/templates/serializer.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/serializer/templates/serializer.rb b/railties/lib/rails/generators/rails/serializer/templates/serializer.rb
new file mode 100644
index 0000000000..30c058c7e9
--- /dev/null
+++ b/railties/lib/rails/generators/rails/serializer/templates/serializer.rb
@@ -0,0 +1,9 @@
+<% module_namespacing do -%>
+class <%= class_name %>Serializer < <%= parent_class_name %>
+<% if attributes.any? -%> attributes <%= attributes_names.map(&:inspect).join(", ") %>
+<% end -%>
+<% association_names.each do |attribute| -%>
+ has_one :<%= attribute %>
+<% end -%>
+end
+<% end -%> \ No newline at end of file