Skip to content
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

Solves problems between MongoMapper and brute_force_protection. #195

Merged
merged 2 commits into from
Jan 24, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/sorcery/model/adapters/mongo_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module MongoMapper

module InstanceMethods
def increment(attr)
self.inc(attr,1)
self.class.increment(id, attr => 1)
end

def save!(options = {})
Expand Down
4 changes: 2 additions & 2 deletions lib/sorcery/model/submodules/brute_force_protection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ module ClassMethods
protected

def define_brute_force_protection_mongoid_fields
field sorcery_config.failed_logins_count_attribute_name, :type => Integer
field sorcery_config.failed_logins_count_attribute_name, :type => Integer, :default => 0
field sorcery_config.lock_expires_at_attribute_name, :type => Time
end

def define_brute_force_protection_mongo_mapper_fields
key sorcery_config.failed_logins_count_attribute_name, Integer
key sorcery_config.failed_logins_count_attribute_name, Integer, :default => 0
key sorcery_config.lock_expires_at_attribute_name, Time
end
end
Expand Down