Skip to content

Commit 205caa7

Browse files
authored
Fix generator for float/decimal (#79)
SR wants :number, payload wants the correct ruby class
1 parent 22bfd06 commit 205caa7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/generators/jsonapi/resource_generator.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def generate_strong_resource
9292
attributes.each do |a|
9393
type = a.type
9494
type = :string if type == :text
95+
type = :number if [:float, :decimal].include?(type)
9596
code << " attribute :#{a.name}, :#{type}\n"
9697
end
9798
code << " end\n"

0 commit comments

Comments
 (0)