Skip to content

model name prefix is not always unique #231

Description

@khiav223577

The document here says:

Redis::Objects automatically creates keys that are unique to each object, in the format:
model_name:id:field_name

But if two models in different namespace have same name. The generated key will be the same.
For example:

class Group < ActiveRecord::Base
  include Redis::Objects
  counter :test_counter
end

class XXX::Group < ActiveRecord::Base
  include Redis::Objects
  counter :test_counter
end
Group.first.test_counter.key
# => "group:1:test_counter"

XXX::Group.first.test_counter.key
# => "group:1:test_counter"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions