Sha256: 38e51384664da4f54b6c6eac0ab63a332bb29e6573257148090892d999478444

Contents?: true

Size: 751 Bytes

Versions: 11

Compression:

Stored size: 751 Bytes

Contents

<% module_namespacing do -%>
class <%= class_name %>Resource < MontageRails::ApplicationResource
  def self.schema_definition
    {
      name: "<%= class_name.downcase.pluralize %>",
      fields: [
      <% attributes.each do |attribute| -%>
  {
          name: "<%= attribute.name -%>",
          datatype: "<%= attribute.type -%>",
        },
      <% end -%>
],
      links: {
        self: "http://testco.dev.montagehot.club/api/v1/schemas/<%= class_name.downcase.pluralize %>/",
        query: "http://testco.dev.montagehot.club/api/v1/schemas/<%= class_name.downcase.pluralize %>/query/",
        create_document: "http://testco.dev.montagehot.club/api/v1/schemas/<%= class_name.downcase.pluralize %>/save/"
      }
    }
  end
end
<% end -%>

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
montage_rails-1.0.0 lib/generators/montage_rails/templates/resource.rb
montage_rails-0.7.4 lib/generators/montage_rails/templates/resource.rb
montage_rails-0.7.3 lib/generators/montage_rails/templates/resource.rb
montage_rails-0.7.2 lib/generators/montage_rails/templates/resource.rb
montage_rails-0.7.1 lib/generators/montage_rails/templates/resource.rb
montage_rails-0.7 lib/generators/montage_rails/templates/resource.rb
montage_rails-0.6.4 lib/generators/montage_rails/templates/resource.rb
montage_rails-0.6.3 lib/generators/montage_rails/templates/resource.rb
montage_rails-0.6.2 lib/generators/montage_rails/templates/resource.rb
montage_rails-0.6.1 lib/generators/montage_rails/templates/resource.rb
montage_rails-0.6.0 lib/generators/montage_rails/templates/resource.rb