Redis-objects list on a Redis-object in ruby -
i have redis-object's list. each object in list needs have list.
class parent include redis::objects list :children, marshal: true end
class children include redis::objects end
the above code samples highlight relationship. include other things attr_accessors etc.
my issue arrives when call children on instance of parent, such in example below:
p = parent.new
redis::list.new('some_key', marshal: true) << p
p.children => nil
i have working example using active record model list added it. including on redis-object seems give me issues.
do need handle situation manually in way described in part 2 of redis-object documentation, or how have create redis-objects list on creation of parent object? thoughts creation implicit
solved. had attr_accessor on parent, named children. clashed list defined name children. removing attr_accessor resulted in empty redis-objects list being returned, expected behavior.
Comments
Post a Comment