Error with trying to code model and collection

Beat my head on this for about an hour.
I can’t see the issue.

I’ve got a Model LatticeScript in plugins/atemods/public/lattice_script.rb (code below).
A file in plugins/atemods/public/atemods_char.rb (code below) that mods the Character class to give character a collection of LatticeScripts they can have. (1 to Many where A character have many latticescripts but an instance of lattice script can have 1 character).

When I try to access the lattice_scripts collection off the character I get:
%% Sorry! The code lost its mind while executing a command. Not your fault.
Please send this error information to the admins and tell them what you were doing at the time:
Description: “ruby ClassTargetFinder.find(“charlie”, Character, nil).target.lattice_scripts”
Error: “uninitialized constant AresMUSH::Character::AresMush”

I don’t think so but do I have to somehow init a collection? I didn’t think so given friendship dosen’t and scenes don’t. Unless I’m missing that code somewhere in the engine.

lattice_script.rb
module AresMUSH
class LatticeScript < Ohm::Model
include ObjectModel
reference :character, “AresMUSH::Character”
attribute :name
end
end

atemods_char.rb
module AresMUSH
class Character
collection :lattice_scripts, “AresMush::LatticeScript”
end
end

1 Like

Looks like it’s just a typo - your collection is using AresMush instead of AresMUSH.

I can not believe I missed that. Yea that was it.
Thank you.

1 Like