Class: Jsonapi::ResourceGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Jsonapi::ResourceGenerator
- Defined in:
- lib/generators/jsonapi/resource_generator.rb
Instance Method Summary collapse
Instance Method Details
#copy_resource_file ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/generators/jsonapi/resource_generator.rb', line 19 def copy_resource_file unless model_klass raise "You must define a #{class_name} model before generating the corresponding resource." end generate_controller generate_serializer generate_application_resource unless application_resource_defined? generate_spec_payload if actions?('create', 'update') generate_strong_resource end generate_route generate_tests generate_resource end |