I have a very strange error that I have never encountered and cannot find the answer anywhere. I have class definitions that look like this:
class Base
class CacheKey
class_attribute :cache_key_template, :instance_writer => false
self.cache_key_template = "base:tracker-%s-%s"
end
end
class Other
class CacheKey < ::Base::CacheKey
self.cache_key_template = "other:tracker-%s-%s"
end
end
However, when I switch to the console session, it causes some funky personality
$ rails console
> Base::CacheKey.cache_key_template
=> "base:tracker-%s-%s"
> Other::CacheKey.cache_key_template
=> "base:tracker-%s-%s"
> Other::CacheKey
=> Base::CacheKey
Hmm, strange. How about a different way?
$ rails console
> Other::CacheKey.cache_key_template
=> "other:tracker-%s-%s"
> Base::CacheKey.cache_key_template
=> "base:tracker-%s-%s"
> Other::CacheKey
=> Other::CacheKey
I'm really at a standstill.
source
share