I have a model Agent that belongs_to
Scenario. Both models have the field options
and I would like to merge the values stored in Scenario
options
with Agent
options
so that I can do @agent.options
and retrieve the values from both Agent
and Scenario
.
I tried:
# in agent.rb
def options
scenario.options.merge(self.options)
end
But this throws a Stack too deep
error.
Any suggestions would be greatly appreciated. Thanks!