I have two arrays which I would like to initialise to [] in my Prediction model's object.
If I try:
def initialize
@first_estimation = []
@last_estimation = []
end
Then many of my unit tests fail.
Failure/Error: assign(:prediction, Prediction.new(
ArgumentError:
wrong number of arguments (1 for 0)
However, if I try:
def after_initialize
@first_estimation = []
@last_estimation = []
end
Then the arrays do not get instantiated.
How can I instantiate the arrays when the object is constructed without altering anything else?