2

The model is defined as follows

attr_accessor :delay_type, :stop_type

This raises the following warning by reek

Order#stop_type is a writable attribute

Any idea on how to fix this?

prajeesh
  • 2,202
  • 6
  • 34
  • 59
  • 1
    You're making of both `delay_type` and `stop_type` a writable and readable attribute, which might not be needed if you're only using them to get their values, not to reassign them. If so, changing `attr_accessor` for `attr_reader` should remove the warning. – Sebastián Palma Jan 15 '20 at 09:35

1 Answers1

1

attr_accessor creates both attr_reader and attr_writer.

You have created both but you are not using the writer so reek is raising a warning that you have extra code that is not being used.

You should either ignore the warning if you will use the writer later or do this:

attr_accessor :delay_type
attr_reader :stop_type
ARK
  • 772
  • 7
  • 21