-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from dks17/custom_fields
Customizable :locked_at and :locked_until fields
- Loading branch information
Showing
18 changed files
with
694 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,79 @@ | ||
# This configuration was generated by `rubocop --auto-gen-config` | ||
# on 2015-10-21 11:03:44 -0400 using RuboCop version 0.29.1. | ||
# This configuration was generated by | ||
# `rubocop --auto-gen-config` | ||
# on 2018-08-22 18:00:04 +0300 using RuboCop version 0.58.2. | ||
# The point is for the user to remove these configuration records | ||
# one by one as the offenses are removed from the code base. | ||
# Note that changes in the inspected code, or installation of new | ||
# versions of RuboCop, may require this file to be generated again. | ||
|
||
# Offense count: 1 | ||
# Offense count: 6 | ||
# Configuration parameters: Include. | ||
# Include: **/*.gemfile, **/Gemfile, **/gems.rb | ||
Bundler/DuplicatedGem: | ||
Exclude: | ||
- 'Gemfile' | ||
|
||
# Offense count: 2 | ||
Metrics/AbcSize: | ||
Max: 18 | ||
Max: 20 | ||
|
||
# Offense count: 37 | ||
# Configuration parameters: AllowURI, URISchemes. | ||
Metrics/LineLength: | ||
Max: 184 | ||
# Offense count: 5 | ||
# Configuration parameters: CountComments, ExcludedMethods. | ||
# ExcludedMethods: refine | ||
Metrics/BlockLength: | ||
Max: 478 | ||
|
||
# Offense count: 3 | ||
# Offense count: 2 | ||
# Configuration parameters: CountComments. | ||
Metrics/MethodLength: | ||
Max: 25 | ||
|
||
# Offense count: 6 | ||
# Cop supports --auto-correct. | ||
Style/Blocks: | ||
Enabled: false | ||
# Offense count: 1 | ||
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist, MethodDefinitionMacros. | ||
# NamePrefix: is_, has_, have_ | ||
# NamePrefixBlacklist: is_, has_, have_ | ||
# NameWhitelist: is_a? | ||
# MethodDefinitionMacros: define_method, define_singleton_method | ||
Naming/PredicateName: | ||
Exclude: | ||
- 'spec/**/*' | ||
- 'lib/mongoid/locker.rb' | ||
|
||
# Offense count: 3 | ||
# Offense count: 2 | ||
Style/Documentation: | ||
Enabled: false | ||
Exclude: | ||
- 'spec/**/*' | ||
- 'test/**/*' | ||
- 'lib/mongoid/locker.rb' | ||
|
||
# Offense count: 2 | ||
Style/DoubleNegation: | ||
Enabled: false | ||
|
||
# Offense count: 2 | ||
# Configuration parameters: Exclude. | ||
Style/FileName: | ||
Enabled: false | ||
Exclude: | ||
- 'lib/mongoid/locker.rb' | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: NamePrefix, NamePrefixBlacklist. | ||
Style/PredicateName: | ||
Enabled: false | ||
# Configuration parameters: MinBodyLength. | ||
Style/GuardClause: | ||
Exclude: | ||
- 'lib/mongoid/locker.rb' | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: SupportedStyles. | ||
# Cop supports --auto-correct. | ||
# Configuration parameters: . | ||
# SupportedStyles: compact, exploded | ||
Style/RaiseArgs: | ||
EnforcedStyle: compact | ||
|
||
# Offense count: 2 | ||
Style/RegexpLiteral: | ||
MaxSlashes: 0 | ||
|
||
# Offense count: 1 | ||
# Cop supports --auto-correct. | ||
# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, Whitelist. | ||
Style/TrivialAccessors: | ||
Enabled: false | ||
# Configuration parameters: . | ||
# SupportedStyles: percent, brackets | ||
Style/SymbolArray: | ||
EnforcedStyle: percent | ||
MinSize: 3 | ||
|
||
# Offense count: 63 | ||
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. | ||
# URISchemes: http, https | ||
Metrics/LineLength: | ||
Max: 184 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
danger.import_dangerfile(gem: "mongoid-danger") | ||
danger.import_dangerfile(gem: 'mongoid-danger') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# encoding: utf-8 | ||
|
||
require 'rubygems' | ||
require 'bundler/setup' | ||
require 'bundler/gem_tasks' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
## Upgrading Mongoid Locker | ||
|
||
### Upgrading to 1.0.0 | ||
`Mongoid::Locker` no longer defines `locked_at` and `locked_until` fields when included. You must define these fields manually. | ||
|
||
```ruby | ||
class User | ||
include Mongoid::Document | ||
include Mongoid::Locker | ||
|
||
field :locked_at, type: Time | ||
field :locked_until, type: Time | ||
end | ||
``` | ||
|
||
You can customize the fields used with a `locker` class method or via a global `configure`. See [Customizable :locked_at and :locked_until field names](https://github.com/mongoid/mongoid-locker#customizable-locked_at-and-locked_until-field-names) for more information. | ||
|
||
See [#55](https://github.com/mongoid/mongoid-locker/pull/55) for more information. |
Oops, something went wrong.