Sha256: 6cf4b4d8845022ef185fd497890a29e48b13780593232f353fba1b5eefe73fd2
Contents?: true
Size: 939 Bytes
Versions: 60
Compression:
Stored size: 939 Bytes
Contents
module <%= controller_class %>Helper def render_api_<%= model_name_underscored %>(api, <%= model_name_underscored %>) api.<%= model_name_underscored %> do api.id <%= model_name_underscored %>.id <%- db_columns.keys.each do |column_name| -%> api.<%= column_name %> <%= model_name_underscored %>.<%= column_name %> <%- end -%> <%- if acts_as_customizable? -%> render_api_custom_values <%= model_name_underscored %>.visible_custom_field_values, api <%- end -%> <%- if acts_as_attachable? -%> api.array :attachments do <%= model_name_underscored %>.attachments.each do |attachment| render_api_attachment(attachment, api) end end if include_in_api_response?('attachments') <%- end -%> call_hook(:helper_render_api_<%= model_name_underscored %>, {api: api, <%= model_name_underscored %>: <%= model_name_underscored %>}) end end end
Version data entries
60 entries across 60 versions & 1 rubygems