We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4012507 commit 5a5a5e5Copy full SHA for 5a5a5e5
1 file changed
README.md
@@ -351,15 +351,15 @@ class MovieSerializer
351
include FastJsonapi::ObjectSerializer
352
353
attributes :name, :year
354
- attribute :release_year, if: Proc.new do |record|
+ attribute :release_year, if: Proc.new { |record|
355
# Release year will only be serialized if it's greater than 1990
356
record.release_year > 1990
357
- end
+ }
358
359
- attribute :director, if: Proc.new do |record, params|
+ attribute :director, if: Proc.new { |record, params|
360
# The director will be serialized only if the :admin key of params is true
361
params && params[:admin] == true
362
363
end
364
365
# ...
0 commit comments