Closed Cruikshanks closed 4 years ago
Originated from https://eaflood.atlassian.net/browse/RUBY-309
We have a lot of form objects that look like this:
attr_accessor :foo, :bar, :baz def initialize(registration) self.foo = @transient_registration.foo self.bar = @transient_registration.bar self.baz = @transient_registration.baz end
This seems like a prime candidate for refactoring. Then we could set the variables once as a constant, rather than having the current repetitive situation.
This came out of a code review here: https://github.com/DEFRA/waste-exemptions-engine/pull/139#discussion_r279315668
This has been addressed using delegate
We have a lot of form objects that look like this:
This seems like a prime candidate for refactoring. Then we could set the variables once as a constant, rather than having the current repetitive situation.
This came out of a code review here: https://github.com/DEFRA/waste-exemptions-engine/pull/139#discussion_r279315668