I have the simplest possible Ruby on Rails class:
class ProductProperty < ApplicationRecord
def initialize
puts 'hello world'
end
end
But when I simply try to instantiate it, I get an ArgumentError:
[1] pry(main)> ProductProperty.new
ArgumentError: wrong number of arguments (given 1, expected 0)
I'm unclear why it thinks I am passing an argument in ("given 1"). Do I need to do something else to be able to write an initialize method that doesn't take arguments?
attr_accessors in theinitializemethod based on an array that I can store elsewhere. Open to suggestions if you can think of another way to createattr_accessors based on a class or instance method.