-
Notifications
You must be signed in to change notification settings - Fork 230
lock method conflict activerecord lock method #191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
+1, it's VERY bad, because I don't know how to make DB-level locks now :( |
👍 Facing same issue unable to use active record lock method |
The idea is that using ActiveRecord's lock method is a very bad idea, and If you want to lock using ActiveRecord, you can instead include only those Let me know if you still have issues. On Mon, Feb 22, 2016 at 3:33 AM, Rohan Pujari notifications@github.com
|
@nateware why locking DB is a bad idea?(sorry if my question is silly) |
+1 (sorry for the duplicate issue #196 , i didn't see this one when i submitted it. merge or close it if appropriate, plz) |
+1 # concern
module RedisCacheable
extend ActiveSupport::Concern
included do
class << self
alias_method(:temp_lock_method, :lock)
end
include Redis::Objects
class << self
alias_method(:redis_lock, :lock)
alias_method(:lock, :temp_lock_method)
remove_method(:temp_lock_method)
end
end
end
# model
class User
include RedisCacheable
end |
With all due ❤️ to the author of such a fantastic gem, I must say that this is a fairly questionable attitude. You're polluting our namespace! Just don't! This is why things like semver exist. Rename, bump major version, and let us use AR however we want! Victor |
CC @tmsrjs - this issue is a really good one that needs an in-depth consideration. If we want to rename the |
I'm closing this as a duplicate of #196 so we can consolidate the conversation there. Thanks. |
when include Redis::Objects in model。activerecord's lock was override by Redis::Objects。
The text was updated successfully, but these errors were encountered: