We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a726069 commit 3c5aeb7Copy full SHA for 3c5aeb7
lib/generators/jsonapi/resource_generator.rb
@@ -90,7 +90,9 @@ def generate_spec_payload
90
def generate_strong_resource
91
code = " strong_resource :#{file_name} do\n"
92
attributes.each do |a|
93
- code << " attribute :#{a.name}, :#{a.type}\n"
+ type = a.type
94
+ type = 'string' if type == 'text'
95
+ code << " attribute :#{a.name}, :#{type}\n"
96
end
97
code << " end\n"
98
lib/generators/jsonapi/templates/payload.rb.erb
@@ -32,6 +32,7 @@
32
JsonapiSpecHelpers::Payload.register(:<%= file_name %>) do
33
<%- attributes.each do |a| -%>
34
<%- type = a.type == :boolean ? [TrueClass, FalseClass] : a.type.to_s.classify -%>
35
+ <%- type = String if a.type == :text -%>
36
key(:<%= a.name %>, <%= type %>)
37
<%- end -%>
38
0 commit comments