After doing bundle exec rubocop -p
for this perticular line I am getting offense.
post = current_timeline.posts.build(post_params.merge({ avatars: params[:avatars] }))
The offense is: Style/BracesAroundHashParameters: Redundant curly braces around a hash parameter.
How to fix it? I am new to rubocop in ruby.
You can simply remove redundant curly braces:
post = current_timeline.posts.build(post_params.merge(avatars: params[:avatars]))
They are not needed for the last argument passed into a method being Hash
literal.