commit
89076ba782
88 changed files with 351 additions and 228 deletions
226
.rubocop.yml
226
.rubocop.yml
|
@ -8,9 +8,21 @@ AllCops:
|
||||||
Bundler/DuplicatedGem:
|
Bundler/DuplicatedGem:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Bundler/InsecureProtocolSource:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Bundler/OrderedGems:
|
Bundler/OrderedGems:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Gemspec/DuplicatedAssignment:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Gemspec/OrderedDependencies:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Gemspec/RequiredRubyVersion:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Layout/AccessModifierIndentation:
|
Layout/AccessModifierIndentation:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
@ -34,6 +46,9 @@ Layout/CaseIndentation:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
EnforcedStyle: end
|
EnforcedStyle: end
|
||||||
|
|
||||||
|
Layout/ClassStructure:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
Layout/ClosingParenthesisIndentation:
|
Layout/ClosingParenthesisIndentation:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
@ -52,6 +67,9 @@ Layout/DotPosition:
|
||||||
Layout/ElseAlignment:
|
Layout/ElseAlignment:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Layout/EmptyComment:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Layout/EmptyLineAfterMagicComment:
|
Layout/EmptyLineAfterMagicComment:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
@ -64,6 +82,9 @@ Layout/EmptyLines:
|
||||||
Layout/EmptyLinesAroundAccessModifier:
|
Layout/EmptyLinesAroundAccessModifier:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Layout/EmptyLinesAroundArguments:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Layout/EmptyLinesAroundBeginBody:
|
Layout/EmptyLinesAroundBeginBody:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
@ -219,9 +240,6 @@ Layout/SpaceInsideArrayPercentLiteral:
|
||||||
Layout/SpaceInsideBlockBraces:
|
Layout/SpaceInsideBlockBraces:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
Layout/SpaceInsideBrackets:
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
Layout/SpaceInsideHashLiteralBraces:
|
Layout/SpaceInsideHashLiteralBraces:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
@ -237,6 +255,9 @@ Layout/SpaceInsidePercentLiteralDelimiters:
|
||||||
Layout/SpaceInsideRangeLiteral:
|
Layout/SpaceInsideRangeLiteral:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Layout/SpaceInsideReferenceBrackets:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Layout/SpaceInsideStringInterpolation:
|
Layout/SpaceInsideStringInterpolation:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
@ -253,52 +274,58 @@ Lint/AmbiguousBlockAssociation:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Lint/AmbiguousOperator:
|
Lint/AmbiguousOperator:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Lint/AmbiguousRegexpLiteral:
|
Lint/AmbiguousRegexpLiteral:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Lint/AssignmentInCondition:
|
Lint/AssignmentInCondition:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
|
Lint/BigDecimalNew:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Lint/BooleanSymbol:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Lint/CircularArgumentReference:
|
Lint/CircularArgumentReference:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Lint/Debugger:
|
Lint/Debugger:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Lint/DeprecatedClassMethods:
|
Lint/DeprecatedClassMethods:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Lint/DuplicateCaseCondition:
|
Lint/DuplicateCaseCondition:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Lint/DuplicateMethods:
|
Lint/DuplicateMethods:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Lint/DuplicatedKey:
|
Lint/DuplicatedKey:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Lint/EachWithObjectArgument:
|
Lint/EachWithObjectArgument:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Lint/ElseLayout:
|
Lint/ElseLayout:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Lint/EmptyEnsure:
|
Lint/EmptyEnsure:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Lint/EmptyExpression:
|
Lint/EmptyExpression:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Lint/EmptyInterpolation:
|
Lint/EmptyInterpolation:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Lint/EmptyWhen:
|
Lint/EmptyWhen:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Lint/EndInMethod:
|
Lint/EndInMethod:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Lint/EnsureReturn:
|
Lint/EnsureReturn:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
@ -321,7 +348,10 @@ Lint/IneffectiveAccessModifier:
|
||||||
Lint/InheritException:
|
Lint/InheritException:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Lint/LiteralInCondition:
|
Lint/InterpolationCheck:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Lint/LiteralAsCondition:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Lint/LiteralInInterpolation:
|
Lint/LiteralInInterpolation:
|
||||||
|
@ -330,18 +360,30 @@ Lint/LiteralInInterpolation:
|
||||||
Lint/Loop:
|
Lint/Loop:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Lint/MissingCopEnableDirective:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Lint/MultipleCompare:
|
Lint/MultipleCompare:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Lint/NestedMethodDefinition:
|
Lint/NestedMethodDefinition:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Lint/NestedPercentLiteral:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Lint/NextWithoutAccumulator:
|
Lint/NextWithoutAccumulator:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Lint/NonLocalExitFromIterator:
|
Lint/NonLocalExitFromIterator:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Lint/NumberConversion:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Lint/OrderedMagicComments:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Lint/ParenthesesAsGroupedExpression:
|
Lint/ParenthesesAsGroupedExpression:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
@ -354,6 +396,15 @@ Lint/PercentSymbolArray:
|
||||||
Lint/RandOne:
|
Lint/RandOne:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Lint/RedundantWithIndex:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Lint/RedundantWithObject:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Lint/RegexpAsCondition:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Lint/RequireParentheses:
|
Lint/RequireParentheses:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
@ -372,6 +423,9 @@ Lint/SafeNavigationChain:
|
||||||
Lint/ScriptPermission:
|
Lint/ScriptPermission:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Lint/ShadowedArgument:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Lint/ShadowedException:
|
Lint/ShadowedException:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
@ -390,9 +444,15 @@ Lint/UnderscorePrefixedVariableName:
|
||||||
Lint/UnifiedInteger:
|
Lint/UnifiedInteger:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Lint/UnneededDisable:
|
Lint/UnneededCopDisableDirective:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Lint/UnneededCopEnableDirective:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Lint/UnneededRequireStatement:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Lint/UnneededSplatExpansion:
|
Lint/UnneededSplatExpansion:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
@ -477,6 +537,9 @@ Naming/ConstantName:
|
||||||
Naming/FileName:
|
Naming/FileName:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Naming/HeredocDelimiterCase:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Naming/HeredocDelimiterNaming:
|
Naming/HeredocDelimiterNaming:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
@ -489,6 +552,9 @@ Naming/MethodName:
|
||||||
Naming/PredicateName:
|
Naming/PredicateName:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Naming/UncommunicativeBlockParamName:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Naming/UncommunicativeMethodParamName:
|
Naming/UncommunicativeMethodParamName:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
@ -567,20 +633,29 @@ Performance/StringReplacement:
|
||||||
Performance/TimesMap:
|
Performance/TimesMap:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Performance/UnfreezeString:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Performance/UriDefaultParser:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Rails/ActionFilter:
|
Rails/ActionFilter:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
|
Rails/ActiveRecordAliases:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Rails/ActiveSupportAliases:
|
Rails/ActiveSupportAliases:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Rails/ApplicationJob:
|
Rails/ApplicationJob:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Rails/ApplicationRecord:
|
Rails/ApplicationRecord:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Rails/Blank:
|
Rails/Blank:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Rails/CreateTableWithTimestamps:
|
Rails/CreateTableWithTimestamps:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
@ -592,28 +667,30 @@ Rails/Delegate:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Rails/DelegateAllowBlank:
|
Rails/DelegateAllowBlank:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Rails/DynamicFindBy:
|
Rails/DynamicFindBy:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
Exclude:
|
||||||
|
- "spec/features/**/*.rb"
|
||||||
|
|
||||||
Rails/EnumUniqueness:
|
Rails/EnumUniqueness:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Rails/EnvironmentComparison:
|
Rails/EnvironmentComparison:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Rails/Exit:
|
Rails/Exit:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Rails/FilePath:
|
Rails/FilePath:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Rails/FindBy:
|
Rails/FindBy:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Rails/FindEach:
|
Rails/FindEach:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Rails/HasAndBelongsToMany:
|
Rails/HasAndBelongsToMany:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
@ -622,7 +699,7 @@ Rails/HasManyOrHasOneDependent:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Rails/HttpPositionalArguments:
|
Rails/HttpPositionalArguments:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Rails/InverseOf:
|
Rails/InverseOf:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
@ -640,10 +717,10 @@ Rails/OutputSafety:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
Rails/PluralizationGrammar:
|
Rails/PluralizationGrammar:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Rails/Presence:
|
Rails/Presence:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Rails/Present:
|
Rails/Present:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
@ -651,23 +728,26 @@ Rails/Present:
|
||||||
Rails/ReadWriteAttribute:
|
Rails/ReadWriteAttribute:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Rails/RedundantReceiverInWithOptions:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Rails/RelativeDateConstant:
|
Rails/RelativeDateConstant:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Rails/RequestReferer:
|
Rails/RequestReferer:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Rails/ReversibleMigration:
|
Rails/ReversibleMigration:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Rails/SafeNavigation:
|
Rails/SafeNavigation:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Rails/SaveBang:
|
Rails/SaveBang:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Rails/ScopeArgs:
|
Rails/ScopeArgs:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Rails/SkipsModelValidations:
|
Rails/SkipsModelValidations:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
@ -676,13 +756,13 @@ Rails/TimeZone:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Rails/UniqBeforePluck:
|
Rails/UniqBeforePluck:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Rails/UnknownEnv:
|
Rails/UnknownEnv:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Rails/Validation:
|
Rails/Validation:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Rails:
|
Rails:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
@ -691,16 +771,19 @@ RSpec/Focused:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
Security/Eval:
|
Security/Eval:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Security/JSONLoad:
|
Security/JSONLoad:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Security/MarshalLoad:
|
Security/MarshalLoad:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
|
Security/Open:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Security/YAMLLoad:
|
Security/YAMLLoad:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Style/Alias:
|
Style/Alias:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
@ -759,6 +842,9 @@ Style/CollectionMethods:
|
||||||
Style/ColonMethodCall:
|
Style/ColonMethodCall:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Style/ColonMethodDefinition:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Style/CommandLiteral:
|
Style/CommandLiteral:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
@ -780,6 +866,9 @@ Style/DateTime:
|
||||||
Style/DefWithParentheses:
|
Style/DefWithParentheses:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Style/Dir:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Style/Documentation:
|
Style/Documentation:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
@ -795,12 +884,21 @@ Style/EachForSimpleLoop:
|
||||||
Style/EachWithObject:
|
Style/EachWithObject:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Style/EmptyBlockParameter:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Style/EmptyCaseCondition:
|
Style/EmptyCaseCondition:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Style/EmptyElse:
|
Style/EmptyElse:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Style/EmptyLambdaParameter:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Style/EmptyLineAfterGuardClause:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
Style/EmptyLiteral:
|
Style/EmptyLiteral:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
@ -819,6 +917,9 @@ Style/EvalWithLocation:
|
||||||
Style/EvenOdd:
|
Style/EvenOdd:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Style/ExpandPathArguments:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Style/FlipFlop:
|
Style/FlipFlop:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
@ -843,9 +944,6 @@ Style/GuardClause:
|
||||||
Style/HashSyntax:
|
Style/HashSyntax:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Style/HeredocDelimiters:
|
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
Style/IdenticalConditionalBranches:
|
Style/IdenticalConditionalBranches:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
@ -897,6 +995,9 @@ Style/MethodDefParentheses:
|
||||||
Style/MethodMissing:
|
Style/MethodMissing:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Style/MinMax:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Style/MissingElse:
|
Style/MissingElse:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
@ -978,6 +1079,9 @@ Style/OptionalArguments:
|
||||||
Style/ParallelAssignment:
|
Style/ParallelAssignment:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Style/OrAssignment:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Style/ParenthesesAroundCondition:
|
Style/ParenthesesAroundCondition:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
@ -1005,6 +1109,9 @@ Style/RandomWithOffset:
|
||||||
Style/RedundantBegin:
|
Style/RedundantBegin:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Style/RedundantConditional:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Style/RedundantException:
|
Style/RedundantException:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
@ -1029,6 +1136,9 @@ Style/RescueModifier:
|
||||||
Style/RescueStandardError:
|
Style/RescueStandardError:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Style/ReturnNil:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
Style/SafeNavigation:
|
Style/SafeNavigation:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
@ -1056,6 +1166,12 @@ Style/SpecialGlobalVars:
|
||||||
Style/StabbyLambdaParentheses:
|
Style/StabbyLambdaParentheses:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Style/StderrPuts:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Style/StringHashKeys:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
Style/StringLiterals:
|
Style/StringLiterals:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
@ -1080,6 +1196,15 @@ Style/SymbolProc:
|
||||||
Style/TernaryParentheses:
|
Style/TernaryParentheses:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Style/TrailingBodyOnClass:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Style/TrailingBodyOnMethodDefinition:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Style/TrailingBodyOnModule:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Style/TrailingCommaInArguments:
|
Style/TrailingCommaInArguments:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
@ -1089,6 +1214,9 @@ Style/TrailingCommaInArrayLiteral:
|
||||||
Style/TrailingCommaInHashLiteral:
|
Style/TrailingCommaInHashLiteral:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
Style/TrailingMethodEndStatement:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Style/TrailingUnderscoreVariable:
|
Style/TrailingUnderscoreVariable:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ class Admin::GestionnairesController < AdminController
|
||||||
|
|
||||||
def create
|
def create
|
||||||
email = params[:gestionnaire][:email].downcase
|
email = params[:gestionnaire][:email].downcase
|
||||||
@gestionnaire = Gestionnaire.find_by_email(email)
|
@gestionnaire = Gestionnaire.find_by(email: email)
|
||||||
procedure_id = params[:procedure_id]
|
procedure_id = params[:procedure_id]
|
||||||
|
|
||||||
if @gestionnaire.nil?
|
if @gestionnaire.nil?
|
||||||
|
|
|
@ -132,7 +132,7 @@ class Admin::ProceduresController < AdminController
|
||||||
return redirect_to admin_procedures_path
|
return redirect_to admin_procedures_path
|
||||||
end
|
end
|
||||||
|
|
||||||
procedure_path = ProcedurePath.find_by_path(params[:procedure_path])
|
procedure_path = ProcedurePath.find_by(path: params[:procedure_path])
|
||||||
if procedure_path
|
if procedure_path
|
||||||
if procedure_path.administrateur_id == current_administrateur.id
|
if procedure_path.administrateur_id == current_administrateur.id
|
||||||
procedure_path.procedure.archive
|
procedure_path.procedure.archive
|
||||||
|
@ -154,7 +154,7 @@ class Admin::ProceduresController < AdminController
|
||||||
end
|
end
|
||||||
|
|
||||||
def transfer
|
def transfer
|
||||||
admin = Administrateur.find_by_email(params[:email_admin].downcase)
|
admin = Administrateur.find_by(email: params[:email_admin].downcase)
|
||||||
|
|
||||||
if admin.nil?
|
if admin.nil?
|
||||||
render '/admin/procedures/transfer', formats: 'js', status: 404
|
render '/admin/procedures/transfer', formats: 'js', status: 404
|
||||||
|
|
|
@ -13,7 +13,7 @@ class APIController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def current_administrateur
|
def current_administrateur
|
||||||
@administrateur ||= Administrateur.find_by_api_token(params[:token])
|
@administrateur ||= Administrateur.find_by(api_token: params[:token])
|
||||||
end
|
end
|
||||||
|
|
||||||
def default_format_json
|
def default_format_json
|
||||||
|
|
|
@ -9,7 +9,7 @@ class InvitesController < ApplicationController
|
||||||
|
|
||||||
email = params[:email].downcase
|
email = params[:email].downcase
|
||||||
|
|
||||||
user = User.find_by_email(email)
|
user = User.find_by(email: email)
|
||||||
invite = class_var.create(dossier: dossier, user: user, email: email, email_sender: email_sender)
|
invite = class_var.create(dossier: dossier, user: user, email: email, email_sender: email_sender)
|
||||||
|
|
||||||
if invite.valid?
|
if invite.valid?
|
||||||
|
|
|
@ -13,7 +13,7 @@ module NewGestionnaire
|
||||||
@avis_a_donner = gestionnaire_avis.without_answer
|
@avis_a_donner = gestionnaire_avis.without_answer
|
||||||
@avis_donnes = gestionnaire_avis.with_answer
|
@avis_donnes = gestionnaire_avis.with_answer
|
||||||
|
|
||||||
@statut = params[:statut].present? ? params[:statut] : A_DONNER_STATUS
|
@statut = params[:statut].presence || A_DONNER_STATUS
|
||||||
|
|
||||||
@avis = case @statut
|
@avis = case @statut
|
||||||
when A_DONNER_STATUS
|
when A_DONNER_STATUS
|
||||||
|
|
|
@ -76,7 +76,7 @@ module NewGestionnaire
|
||||||
filtered_sorted_ids = sorted_ids
|
filtered_sorted_ids = sorted_ids
|
||||||
end
|
end
|
||||||
|
|
||||||
page = params[:page].present? ? params[:page] : 1
|
page = params[:page].presence || 1
|
||||||
|
|
||||||
filtered_sorted_paginated_ids = Kaminari
|
filtered_sorted_paginated_ids = Kaminari
|
||||||
.paginate_array(filtered_sorted_ids)
|
.paginate_array(filtered_sorted_ids)
|
||||||
|
@ -187,7 +187,7 @@ module NewGestionnaire
|
||||||
private
|
private
|
||||||
|
|
||||||
def statut
|
def statut
|
||||||
@statut ||= params[:statut].present? ? params[:statut] : 'a-suivre'
|
@statut ||= (params[:statut].presence || 'a-suivre')
|
||||||
end
|
end
|
||||||
|
|
||||||
def procedure
|
def procedure
|
||||||
|
|
|
@ -170,7 +170,7 @@ class StatsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def avis_usage
|
def avis_usage
|
||||||
[3.week.ago, 2.week.ago, 1.week.ago].map do |min_date|
|
[3.weeks.ago, 2.weeks.ago, 1.week.ago].map do |min_date|
|
||||||
max_date = min_date + 1.week
|
max_date = min_date + 1.week
|
||||||
|
|
||||||
weekly_dossiers = Dossier.includes(:avis).where(created_at: min_date..max_date).to_a
|
weekly_dossiers = Dossier.includes(:avis).where(created_at: min_date..max_date).to_a
|
||||||
|
@ -189,7 +189,7 @@ class StatsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def avis_average_answer_time
|
def avis_average_answer_time
|
||||||
[3.week.ago, 2.week.ago, 1.week.ago].map do |min_date|
|
[3.weeks.ago, 2.weeks.ago, 1.week.ago].map do |min_date|
|
||||||
max_date = min_date + 1.week
|
max_date = min_date + 1.week
|
||||||
|
|
||||||
average = Avis.with_answer
|
average = Avis.with_answer
|
||||||
|
@ -203,7 +203,7 @@ class StatsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def avis_answer_percentages
|
def avis_answer_percentages
|
||||||
[3.week.ago, 2.week.ago, 1.week.ago].map do |min_date|
|
[3.weeks.ago, 2.weeks.ago, 1.week.ago].map do |min_date|
|
||||||
max_date = min_date + 1.week
|
max_date = min_date + 1.week
|
||||||
|
|
||||||
weekly_avis = Avis.where(created_at: min_date..max_date)
|
weekly_avis = Avis.where(created_at: min_date..max_date)
|
||||||
|
@ -222,7 +222,7 @@ class StatsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def motivation_usage_dossier
|
def motivation_usage_dossier
|
||||||
[3.week.ago, 2.week.ago, 1.week.ago].map do |date|
|
[3.weeks.ago, 2.weeks.ago, 1.week.ago].map do |date|
|
||||||
min_date = date.beginning_of_week
|
min_date = date.beginning_of_week
|
||||||
max_date = date.end_of_week
|
max_date = date.end_of_week
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ class StatsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def motivation_usage_procedure
|
def motivation_usage_procedure
|
||||||
[3.week.ago, 2.week.ago, 1.week.ago].map do |date|
|
[3.weeks.ago, 2.weeks.ago, 1.week.ago].map do |date|
|
||||||
min_date = date.beginning_of_week
|
min_date = date.beginning_of_week
|
||||||
max_date = date.end_of_week
|
max_date = date.end_of_week
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ class Users::DescriptionController < UsersController
|
||||||
flash.notice = 'Nouveaux fichiers envoyés' if flash.alert.nil?
|
flash.notice = 'Nouveaux fichiers envoyés' if flash.alert.nil?
|
||||||
end
|
end
|
||||||
|
|
||||||
return redirect_to users_dossiers_invite_path(id: current_user.invites.find_by_dossier_id(@dossier.id).id) if invite
|
return redirect_to users_dossiers_invite_path(id: current_user.invites.find_by(dossier_id: @dossier.id).id) if invite
|
||||||
|
|
||||||
redirect_to users_dossier_recapitulatif_path
|
redirect_to users_dossier_recapitulatif_path
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class Users::Dossiers::InvitesController < UsersController
|
class Users::Dossiers::InvitesController < UsersController
|
||||||
def authenticate_user!
|
def authenticate_user!
|
||||||
session["user_return_to"] = request.fullpath
|
session["user_return_to"] = request.fullpath
|
||||||
return redirect_to new_user_registration_path(user_email: params[:email]) if params[:email].present? && User.find_by_email(params[:email]).nil?
|
return redirect_to new_user_registration_path(user_email: params[:email]) if params[:email].present? && User.find_by(email: params[:email]).nil?
|
||||||
|
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
|
@ -78,7 +78,9 @@ class Users::SessionsController < Sessions::SessionsController
|
||||||
end
|
end
|
||||||
|
|
||||||
def try_to_authenticate(klass, remember_me = false)
|
def try_to_authenticate(klass, remember_me = false)
|
||||||
if resource = klass.find_for_database_authentication(email: params[:user][:email])
|
resource = klass.find_for_database_authentication(email: params[:user][:email])
|
||||||
|
|
||||||
|
if resource.present?
|
||||||
if resource.valid_password?(params[:user][:password])
|
if resource.valid_password?(params[:user][:password])
|
||||||
resource.remember_me = remember_me
|
resource.remember_me = remember_me
|
||||||
sign_in resource
|
sign_in resource
|
||||||
|
|
|
@ -2,7 +2,7 @@ class EntrepriseDecorator < Draper::Decorator
|
||||||
delegate_all
|
delegate_all
|
||||||
|
|
||||||
def raison_sociale_or_name
|
def raison_sociale_or_name
|
||||||
raison_sociale.blank? ? "#{nom} #{prenom}" : raison_sociale
|
raison_sociale.presence || "#{nom} #{prenom}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def effectif
|
def effectif
|
||||||
|
|
|
@ -7,7 +7,9 @@ class FileSizeValidator < ActiveModel::EachValidator
|
||||||
RESERVED_OPTIONS = [:minimum, :maximum, :within, :is, :tokenizer, :too_short, :too_long]
|
RESERVED_OPTIONS = [:minimum, :maximum, :within, :is, :tokenizer, :too_short, :too_long]
|
||||||
|
|
||||||
def initialize(options)
|
def initialize(options)
|
||||||
if range = (options.delete(:in) || options.delete(:within))
|
range = options.delete(:in) || options.delete(:within)
|
||||||
|
|
||||||
|
if range.present?
|
||||||
raise ArgumentError, ":in and :within must be a Range" if !range.is_a?(Range)
|
raise ArgumentError, ":in and :within must be a Range" if !range.is_a?(Range)
|
||||||
options[:minimum], options[:maximum] = range.begin, range.end
|
options[:minimum], options[:maximum] = range.begin, range.end
|
||||||
options[:maximum] -= 1 if range.exclude_end?
|
options[:maximum] -= 1 if range.exclude_end?
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class Administrateur < ActiveRecord::Base
|
class Administrateur < ApplicationRecord
|
||||||
devise :database_authenticatable, :registerable,
|
devise :database_authenticatable, :registerable,
|
||||||
:recoverable, :rememberable, :trackable, :validatable
|
:recoverable, :rememberable, :trackable, :validatable
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class Administration < ActiveRecord::Base
|
class Administration < ApplicationRecord
|
||||||
# Include default devise modules. Others available are:
|
# Include default devise modules. Others available are:
|
||||||
# :confirmable, :lockable, :timeoutable and :omniauthable
|
# :confirmable, :lockable, :timeoutable and :omniauthable
|
||||||
devise :database_authenticatable, :rememberable, :trackable, :validatable, :omniauthable, omniauth_providers: [:github]
|
devise :database_authenticatable, :rememberable, :trackable, :validatable, :omniauthable, omniauth_providers: [:github]
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class AssignTo < ActiveRecord::Base
|
class AssignTo < ApplicationRecord
|
||||||
belongs_to :procedure
|
belongs_to :procedure
|
||||||
belongs_to :gestionnaire
|
belongs_to :gestionnaire
|
||||||
has_one :procedure_presentation, dependent: :destroy
|
has_one :procedure_presentation, dependent: :destroy
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class Cadastre < ActiveRecord::Base
|
class Cadastre < ApplicationRecord
|
||||||
belongs_to :dossier, touch: true
|
belongs_to :dossier, touch: true
|
||||||
|
|
||||||
def geometry
|
def geometry
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class Cerfa < ActiveRecord::Base
|
class Cerfa < ApplicationRecord
|
||||||
belongs_to :dossier, touch: true
|
belongs_to :dossier, touch: true
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class Champ < ActiveRecord::Base
|
class Champ < ApplicationRecord
|
||||||
self.inheritance_column = :_type_disabled
|
self.inheritance_column = :_type_disabled
|
||||||
|
|
||||||
belongs_to :dossier, touch: true
|
belongs_to :dossier, touch: true
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class Commentaire < ActiveRecord::Base
|
class Commentaire < ApplicationRecord
|
||||||
belongs_to :dossier, touch: true
|
belongs_to :dossier, touch: true
|
||||||
belongs_to :champ
|
belongs_to :champ
|
||||||
belongs_to :piece_justificative
|
belongs_to :piece_justificative
|
||||||
|
@ -6,7 +6,7 @@ class Commentaire < ActiveRecord::Base
|
||||||
mount_uploader :file, CommentaireFileUploader
|
mount_uploader :file, CommentaireFileUploader
|
||||||
validates :file, file_size: { maximum: 20.megabytes, message: "La taille du fichier doit être inférieure à 20 Mo" }
|
validates :file, file_size: { maximum: 20.megabytes, message: "La taille du fichier doit être inférieure à 20 Mo" }
|
||||||
validate :is_virus_free?
|
validate :is_virus_free?
|
||||||
validates_presence_of :body, message: "Votre message ne peut être vide"
|
validates :body, presence: { message: "Votre message ne peut être vide" }
|
||||||
|
|
||||||
default_scope { order(created_at: :asc) }
|
default_scope { order(created_at: :asc) }
|
||||||
scope :updated_since?, -> (date) { where('commentaires.updated_at > ?', date) }
|
scope :updated_since?, -> (date) { where('commentaires.updated_at > ?', date) }
|
||||||
|
@ -31,19 +31,12 @@ class Commentaire < ActiveRecord::Base
|
||||||
dossier_user_email = dossier.user.email
|
dossier_user_email = dossier.user.email
|
||||||
invited_users_emails = dossier.invites_user.pluck(:email).to_a
|
invited_users_emails = dossier.invites_user.pluck(:email).to_a
|
||||||
|
|
||||||
case email
|
# - If the email is the contact email, the commentaire is a copy
|
||||||
when I18n.t("dynamics.contact_email")
|
# of an automated notification email we sent to a user, so do nothing.
|
||||||
# The commentaire is a copy of an automated notification email
|
# - If a user or an invited user posted a commentaire, do nothing,
|
||||||
# we sent to a user, so do nothing
|
# the notification system will properly
|
||||||
|
# - Otherwise, a gestionnaire posted a commentaire, we need to notify the user
|
||||||
when dossier_user_email, *invited_users_emails
|
if !email.in?([I18n.t("dynamics.contact_email"), dossier_user_email, *invited_users_emails])
|
||||||
# A user or an inved user posted a commentaire,
|
|
||||||
# do nothing, the notification system will properly
|
|
||||||
|
|
||||||
else
|
|
||||||
# A gestionnaire posted a commentaire,
|
|
||||||
# we need to notify the user
|
|
||||||
|
|
||||||
notify_user
|
notify_user
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class Dossier < ActiveRecord::Base
|
class Dossier < ApplicationRecord
|
||||||
enum state: {
|
enum state: {
|
||||||
brouillon: 'brouillon',
|
brouillon: 'brouillon',
|
||||||
en_construction: 'en_construction',
|
en_construction: 'en_construction',
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class DropDownList < ActiveRecord::Base
|
class DropDownList < ApplicationRecord
|
||||||
belongs_to :type_de_champ
|
belongs_to :type_de_champ
|
||||||
|
|
||||||
def options
|
def options
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
class Entreprise < ActiveRecord::Base
|
class Entreprise < ApplicationRecord
|
||||||
belongs_to :dossier
|
belongs_to :dossier
|
||||||
has_one :etablissement, dependent: :destroy
|
has_one :etablissement, dependent: :destroy
|
||||||
has_one :rna_information, dependent: :destroy
|
has_one :rna_information, dependent: :destroy
|
||||||
|
|
||||||
validates_presence_of :siren
|
validates :siren, presence: true
|
||||||
validates_uniqueness_of :dossier_id
|
validates :dossier_id, uniqueness: true
|
||||||
|
|
||||||
accepts_nested_attributes_for :rna_information
|
accepts_nested_attributes_for :rna_information
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class Etablissement < ActiveRecord::Base
|
class Etablissement < ApplicationRecord
|
||||||
belongs_to :dossier
|
belongs_to :dossier
|
||||||
belongs_to :entreprise
|
belongs_to :entreprise
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ class Etablissement < ActiveRecord::Base
|
||||||
accepts_nested_attributes_for :exercices
|
accepts_nested_attributes_for :exercices
|
||||||
accepts_nested_attributes_for :entreprise
|
accepts_nested_attributes_for :entreprise
|
||||||
|
|
||||||
validates_uniqueness_of :dossier_id
|
validates :dossier_id, uniqueness: true
|
||||||
|
|
||||||
def geo_adresse
|
def geo_adresse
|
||||||
[numero_voie, type_voie, nom_voie, complement_adresse, code_postal, localite].join(' ')
|
[numero_voie, type_voie, nom_voie, complement_adresse, code_postal, localite].join(' ')
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class Exercice < ActiveRecord::Base
|
class Exercice < ApplicationRecord
|
||||||
belongs_to :etablissement
|
belongs_to :etablissement
|
||||||
|
|
||||||
validates :ca, presence: true, allow_blank: false, allow_nil: false
|
validates :ca, presence: true, allow_blank: false, allow_nil: false
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
class Follow < ActiveRecord::Base
|
class Follow < ApplicationRecord
|
||||||
belongs_to :gestionnaire
|
belongs_to :gestionnaire
|
||||||
belongs_to :dossier
|
belongs_to :dossier
|
||||||
|
|
||||||
validates_uniqueness_of :gestionnaire_id, :scope => :dossier_id
|
validates :gestionnaire_id, uniqueness: { scope: :dossier_id }
|
||||||
|
|
||||||
before_create :set_default_date
|
before_create :set_default_date
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class FranceConnectInformation < ActiveRecord::Base
|
class FranceConnectInformation < ApplicationRecord
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
|
|
||||||
validates :france_connect_particulier_id, presence: true, allow_blank: false, allow_nil: false
|
validates :france_connect_particulier_id, presence: true, allow_blank: false, allow_nil: false
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class Gestionnaire < ActiveRecord::Base
|
class Gestionnaire < ApplicationRecord
|
||||||
devise :database_authenticatable, :registerable,
|
devise :database_authenticatable, :registerable,
|
||||||
:recoverable, :rememberable, :trackable, :validatable
|
:recoverable, :rememberable, :trackable, :validatable
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class Individual < ActiveRecord::Base
|
class Individual < ApplicationRecord
|
||||||
belongs_to :dossier
|
belongs_to :dossier
|
||||||
|
|
||||||
validates_uniqueness_of :dossier_id
|
validates :dossier_id, uniqueness: true
|
||||||
validates :gender, presence: true, allow_nil: false, on: :update
|
validates :gender, presence: true, allow_nil: false, on: :update
|
||||||
validates :nom, presence: true, allow_blank: false, allow_nil: false, on: :update
|
validates :nom, presence: true, allow_blank: false, allow_nil: false, on: :update
|
||||||
validates :prenom, presence: true, allow_blank: false, allow_nil: false, on: :update
|
validates :prenom, presence: true, allow_blank: false, allow_nil: false, on: :update
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
class Invite < ActiveRecord::Base
|
class Invite < ApplicationRecord
|
||||||
belongs_to :dossier
|
belongs_to :dossier
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
|
|
||||||
validates_presence_of :email
|
validates :email, presence: true
|
||||||
validates_uniqueness_of :email, :scope => :dossier_id
|
validates :email, uniqueness: { scope: :dossier_id }
|
||||||
|
|
||||||
validates :email, email_format: true
|
validates :email, email_format: true
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class ModuleAPICarto < ActiveRecord::Base
|
class ModuleAPICarto < ApplicationRecord
|
||||||
belongs_to :procedure
|
belongs_to :procedure
|
||||||
|
|
||||||
validates :use_api_carto, presence: true, allow_blank: true, allow_nil: false
|
validates :use_api_carto, presence: true, allow_blank: true, allow_nil: false
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class PieceJustificative < ActiveRecord::Base
|
class PieceJustificative < ApplicationRecord
|
||||||
belongs_to :dossier, touch: true
|
belongs_to :dossier, touch: true
|
||||||
belongs_to :type_de_piece_justificative
|
belongs_to :type_de_piece_justificative
|
||||||
has_one :commentaire
|
has_one :commentaire
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class Procedure < ActiveRecord::Base
|
class Procedure < ApplicationRecord
|
||||||
has_many :types_de_piece_justificative, -> { order "order_place ASC" }, dependent: :destroy
|
has_many :types_de_piece_justificative, -> { order "order_place ASC" }, dependent: :destroy
|
||||||
has_many :types_de_champ, -> { public_only }, dependent: :destroy
|
has_many :types_de_champ, -> { public_only }, dependent: :destroy
|
||||||
has_many :types_de_champ_private, -> { private_only }, class_name: 'TypeDeChamp', dependent: :destroy
|
has_many :types_de_champ_private, -> { private_only }, class_name: 'TypeDeChamp', dependent: :destroy
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class ProcedurePath < ActiveRecord::Base
|
class ProcedurePath < ApplicationRecord
|
||||||
validates :path, format: { with: /\A[a-z0-9_\-]{3,50}\z/ }, presence: true, allow_blank: false, allow_nil: false
|
validates :path, format: { with: /\A[a-z0-9_\-]{3,50}\z/ }, presence: true, allow_blank: false, allow_nil: false
|
||||||
validates :administrateur_id, presence: true, allow_blank: false, allow_nil: false
|
validates :administrateur_id, presence: true, allow_blank: false, allow_nil: false
|
||||||
validates :procedure_id, presence: true, allow_blank: false, allow_nil: false
|
validates :procedure_id, presence: true, allow_blank: false, allow_nil: false
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class ProcedurePresentation < ActiveRecord::Base
|
class ProcedurePresentation < ApplicationRecord
|
||||||
belongs_to :assign_to
|
belongs_to :assign_to
|
||||||
|
|
||||||
def displayed_fields
|
def displayed_fields
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class QuartierPrioritaire < ActiveRecord::Base
|
class QuartierPrioritaire < ApplicationRecord
|
||||||
belongs_to :dossier, touch: true
|
belongs_to :dossier, touch: true
|
||||||
|
|
||||||
def geometry
|
def geometry
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class RNAInformation < ActiveRecord::Base
|
class RNAInformation < ApplicationRecord
|
||||||
belongs_to :entreprise
|
belongs_to :entreprise
|
||||||
|
|
||||||
validates :association_id, presence: true, allow_blank: false, allow_nil: false
|
validates :association_id, presence: true, allow_blank: false, allow_nil: false
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# See:
|
# See:
|
||||||
# - https://robots.thoughtbot.com/implementing-multi-table-full-text-search-with-postgres
|
# - https://robots.thoughtbot.com/implementing-multi-table-full-text-search-with-postgres
|
||||||
# - http://calebthompson.io/talks/search.html
|
# - http://calebthompson.io/talks/search.html
|
||||||
class Search < ActiveRecord::Base
|
class Search < ApplicationRecord
|
||||||
# :nodoc:
|
# :nodoc:
|
||||||
#
|
#
|
||||||
# Englobs a search result (actually a collection of Search objects) so it acts
|
# Englobs a search result (actually a collection of Search objects) so it acts
|
||||||
|
|
|
@ -4,7 +4,7 @@ class Siret
|
||||||
|
|
||||||
attr_accessor :siret
|
attr_accessor :siret
|
||||||
|
|
||||||
validates_presence_of :siret
|
validates :siret, presence: true
|
||||||
validates :siret, siret_format: true
|
validates :siret, siret_format: true
|
||||||
|
|
||||||
before_validation :remove_whitespace
|
before_validation :remove_whitespace
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class TypeDeChamp < ActiveRecord::Base
|
class TypeDeChamp < ApplicationRecord
|
||||||
self.inheritance_column = :_type_disabled
|
self.inheritance_column = :_type_disabled
|
||||||
|
|
||||||
enum type_champs: {
|
enum type_champs: {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class TypeDePieceJustificative < ActiveRecord::Base
|
class TypeDePieceJustificative < ApplicationRecord
|
||||||
has_many :pieces_justificatives, dependent: :destroy
|
has_many :pieces_justificatives, dependent: :destroy
|
||||||
|
|
||||||
belongs_to :procedure
|
belongs_to :procedure
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class User < ActiveRecord::Base
|
class User < ApplicationRecord
|
||||||
enum loged_in_with_france_connect: {
|
enum loged_in_with_france_connect: {
|
||||||
particulier: 'particulier',
|
particulier: 'particulier',
|
||||||
entreprise: 'entreprise'
|
entreprise: 'entreprise'
|
||||||
|
@ -21,7 +21,7 @@ class User < ActiveRecord::Base
|
||||||
include CredentialsSyncableConcern
|
include CredentialsSyncableConcern
|
||||||
|
|
||||||
def self.find_for_france_connect email, siret
|
def self.find_for_france_connect email, siret
|
||||||
user = User.find_by_email(email)
|
user = User.find_by(email: email)
|
||||||
if user.nil?
|
if user.nil?
|
||||||
return User.create(email: email, password: Devise.friendly_token[0, 20], siret: siret)
|
return User.create(email: email, password: Devise.friendly_token[0, 20], siret: siret)
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class StagingAuthService
|
class StagingAuthService
|
||||||
CONFIG_PATH = Rails.root.join("config/basic_auth.yml")
|
CONFIG_PATH = Rails.root.join("config", "basic_auth.yml")
|
||||||
|
|
||||||
def self.authenticate(username, password)
|
def self.authenticate(username, password)
|
||||||
if enabled?
|
if enabled?
|
||||||
|
@ -14,7 +14,7 @@ class StagingAuthService
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.config
|
def self.config
|
||||||
if File.exists?(CONFIG_PATH)
|
if File.exist?(CONFIG_PATH)
|
||||||
YAML.safe_load(File.read(CONFIG_PATH)).symbolize_keys
|
YAML.safe_load(File.read(CONFIG_PATH)).symbolize_keys
|
||||||
else
|
else
|
||||||
{}
|
{}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class AttestationTemplateLogoUploader < BaseUploader
|
class AttestationTemplateLogoUploader < BaseUploader
|
||||||
def root
|
def root
|
||||||
File.join(Rails.root, 'public')
|
Rails.root.join("public")
|
||||||
end
|
end
|
||||||
|
|
||||||
# Choose what kind of storage to use for this uploader:
|
# Choose what kind of storage to use for this uploader:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class AttestationTemplateSignatureUploader < BaseUploader
|
class AttestationTemplateSignatureUploader < BaseUploader
|
||||||
def root
|
def root
|
||||||
File.join(Rails.root, 'public')
|
Rails.root.join("public")
|
||||||
end
|
end
|
||||||
|
|
||||||
# Choose what kind of storage to use for this uploader:
|
# Choose what kind of storage to use for this uploader:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class AttestationUploader < BaseUploader
|
class AttestationUploader < BaseUploader
|
||||||
def root
|
def root
|
||||||
File.join(Rails.root, 'public')
|
Rails.root.join("public")
|
||||||
end
|
end
|
||||||
|
|
||||||
# Choose what kind of storage to use for this uploader:
|
# Choose what kind of storage to use for this uploader:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class CommentaireFileUploader < BaseUploader
|
class CommentaireFileUploader < BaseUploader
|
||||||
def root
|
def root
|
||||||
File.join(Rails.root, 'public')
|
Rails.root.join("public")
|
||||||
end
|
end
|
||||||
|
|
||||||
if Features.remote_storage
|
if Features.remote_storage
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'securerandom'
|
require 'securerandom'
|
||||||
|
|
||||||
class LocalDownloader
|
class LocalDownloader
|
||||||
BASE_PATH_DISK = File.join(Rails.root, "public/downloads/")
|
BASE_PATH_DISK = Rails.root.join("public", "downloads")
|
||||||
|
|
||||||
def initialize(filename, filename_suffix = '')
|
def initialize(filename, filename_suffix = '')
|
||||||
@filename = filename.to_s
|
@filename = filename.to_s
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class ProcedureLogoUploader < BaseUploader
|
class ProcedureLogoUploader < BaseUploader
|
||||||
def root
|
def root
|
||||||
File.join(Rails.root, "public")
|
Rails.root.join("public")
|
||||||
end
|
end
|
||||||
|
|
||||||
# Choose what kind of storage to use for this uploader:
|
# Choose what kind of storage to use for this uploader:
|
||||||
|
|
|
@ -2,7 +2,7 @@ Apipie.configure do |config|
|
||||||
config.app_name = "API demarches-simplifiees.fr"
|
config.app_name = "API demarches-simplifiees.fr"
|
||||||
config.api_base_url = "/api/v1"
|
config.api_base_url = "/api/v1"
|
||||||
config.doc_base_url = "/docs"
|
config.doc_base_url = "/docs"
|
||||||
config.api_controllers_matcher = File.join(Rails.root, "app", "controllers","api","v1", "**","*.rb")
|
config.api_controllers_matcher = Rails.root.join("app", "controllers"," api", "v1", "**", "*.rb")
|
||||||
config.markup = Apipie::Markup::Markdown.new
|
config.markup = Apipie::Markup::Markdown.new
|
||||||
config.default_version = '1.0'
|
config.default_version = '1.0'
|
||||||
config.validate = false
|
config.validate = false
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
require_relative 'features'
|
require_relative 'features'
|
||||||
|
|
||||||
if Rails.env.test?
|
if Rails.env.test?
|
||||||
Fog.credentials_path = Rails.root.join('config/fog_credentials.test.yml')
|
Fog.credentials_path = Rails.root.join('config', 'fog_credentials.test.yml')
|
||||||
else
|
else
|
||||||
Fog.credentials_path = Rails.root.join('config/fog_credentials.yml')
|
Fog.credentials_path = Rails.root.join('config', 'fog_credentials.yml')
|
||||||
end
|
end
|
||||||
|
|
||||||
CarrierWave.configure do |config|
|
CarrierWave.configure do |config|
|
||||||
|
@ -20,7 +20,7 @@ CarrierWave.configure do |config|
|
||||||
# they will not be available for public (non-authenticated) downloading
|
# they will not be available for public (non-authenticated) downloading
|
||||||
config.root = Rails.root
|
config.root = Rails.root
|
||||||
|
|
||||||
config.cache_dir = "#{Rails.root}/uploads"
|
config.cache_dir = Rails.root.join("uploads")
|
||||||
|
|
||||||
config.fog_public = true
|
config.fog_public = true
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ FRANCE_CONNECT = if Rails.env.test?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fc_config_file_path = "#{Rails.root}/config/france_connect.yml"
|
fc_config_file_path = Rails.root.join("config", "france_connect.yml")
|
||||||
|
|
||||||
# FIXME: with a yaml with a { particulier: {} } structure
|
# FIXME: with a yaml with a { particulier: {} } structure
|
||||||
config_hash = YAML.safe_load(File.read(fc_config_file_path))
|
config_hash = YAML.safe_load(File.read(fc_config_file_path))
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
class UpdateModuleAPICarto < ActiveRecord::Migration
|
class UpdateModuleAPICarto < ActiveRecord::Migration
|
||||||
class Procedure < ActiveRecord::Base
|
class Procedure < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
class ModuleAPICarto < ActiveRecord::Base
|
class ModuleAPICarto < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def up
|
def up
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
class CreateFranceConnectInformation < ActiveRecord::Migration
|
class CreateFranceConnectInformation < ActiveRecord::Migration
|
||||||
class User < ActiveRecord::Base
|
class User < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
class FranceConnectInformation < ActiveRecord::Base
|
class FranceConnectInformation < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def up
|
def up
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class DBremovePieceJustificativeEmpty < ActiveRecord::Migration
|
class DBremovePieceJustificativeEmpty < ActiveRecord::Migration
|
||||||
class PieceJustificative < ActiveRecord::Base
|
class PieceJustificative < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def change
|
def change
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
class PieceJustificativeHaveUser < ActiveRecord::Migration
|
class PieceJustificativeHaveUser < ActiveRecord::Migration
|
||||||
class PieceJustificative < ActiveRecord::Base
|
class PieceJustificative < ApplicationRecord
|
||||||
belongs_to :dossier
|
belongs_to :dossier
|
||||||
end
|
end
|
||||||
|
|
||||||
class Dossier < ActiveRecord::Base
|
class Dossier < ApplicationRecord
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
end
|
end
|
||||||
|
|
||||||
class User < ActiveRecord::Base
|
class User < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def change
|
def change
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
class CerfaHaveUser < ActiveRecord::Migration
|
class CerfaHaveUser < ActiveRecord::Migration
|
||||||
class Cerfa < ActiveRecord::Base
|
class Cerfa < ApplicationRecord
|
||||||
belongs_to :dossier
|
belongs_to :dossier
|
||||||
end
|
end
|
||||||
|
|
||||||
class Dossier < ActiveRecord::Base
|
class Dossier < ApplicationRecord
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
end
|
end
|
||||||
|
|
||||||
class User < ActiveRecord::Base
|
class User < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def change
|
def change
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
class AdminHasAndBelongGestionnaire < ActiveRecord::Migration
|
class AdminHasAndBelongGestionnaire < ActiveRecord::Migration
|
||||||
class Gestionnaire < ActiveRecord::Base
|
class Gestionnaire < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
class AdministrateursGestionnaire < ActiveRecord::Base
|
class AdministrateursGestionnaire < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def up
|
def up
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
class GestionnaireIsAssignToProcedure < ActiveRecord::Migration
|
class GestionnaireIsAssignToProcedure < ActiveRecord::Migration
|
||||||
class AssignTo < ActiveRecord::Base
|
class AssignTo < ApplicationRecord
|
||||||
belongs_to :gestionnaire
|
belongs_to :gestionnaire
|
||||||
belongs_to :procedure
|
belongs_to :procedure
|
||||||
end
|
end
|
||||||
|
|
||||||
class Gestionnaire < ActiveRecord::Base
|
class Gestionnaire < ApplicationRecord
|
||||||
has_and_belongs_to_many :administrateurs
|
has_and_belongs_to_many :administrateurs
|
||||||
has_many :procedures, through: :assign_to
|
has_many :procedures, through: :assign_to
|
||||||
end
|
end
|
||||||
|
|
||||||
class Administrateur < ActiveRecord::Base
|
class Administrateur < ApplicationRecord
|
||||||
has_and_belongs_to_many :gestionnaires
|
has_and_belongs_to_many :gestionnaires
|
||||||
has_many :procedures
|
has_many :procedures
|
||||||
end
|
end
|
||||||
|
|
||||||
class Procedure < ActiveRecord::Base
|
class Procedure < ApplicationRecord
|
||||||
belongs_to :administrateur
|
belongs_to :administrateur
|
||||||
has_many :gestionnaires, through: :assign_to
|
has_many :gestionnaires, through: :assign_to
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
class SetOriginalFilenameForUploaders < ActiveRecord::Migration
|
class SetOriginalFilenameForUploaders < ActiveRecord::Migration
|
||||||
class PieceJustificative < ActiveRecord::Base
|
class PieceJustificative < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
class Cerfa < ActiveRecord::Base
|
class Cerfa < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def change
|
def change
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class AddProcedureStatus < ActiveRecord::Migration
|
class AddProcedureStatus < ActiveRecord::Migration
|
||||||
class Procedure < ActiveRecord::Base
|
class Procedure < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def change
|
def change
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
class DeleteDefaultDescriptionToDossier < ActiveRecord::Migration
|
class DeleteDefaultDescriptionToDossier < ActiveRecord::Migration
|
||||||
class Dossier < ActiveRecord::Base
|
class Dossier < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
class Champ < ActiveRecord::Base
|
class Champ < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
class Procedure < ActiveRecord::Base
|
class Procedure < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
class TypeDeChamp < ActiveRecord::Base
|
class TypeDeChamp < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def up
|
def up
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class ConvertAllDatetimeToDateOnDatabase < ActiveRecord::Migration
|
class ConvertAllDatetimeToDateOnDatabase < ActiveRecord::Migration
|
||||||
class TypeDeChamp < ActiveRecord::Base
|
class TypeDeChamp < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def change
|
def change
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class AddProcedurePathMappingTable < ActiveRecord::Migration
|
class AddProcedurePathMappingTable < ActiveRecord::Migration
|
||||||
class ProcedurePath < ActiveRecord::Base
|
class ProcedurePath < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def change
|
def change
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class BuildDefaultPreferenceListDossier < ActiveRecord::Migration
|
class BuildDefaultPreferenceListDossier < ActiveRecord::Migration
|
||||||
class Gestionnaire < ActiveRecord::Base
|
class Gestionnaire < ApplicationRecord
|
||||||
def build_default_preferences_list_dossier
|
def build_default_preferences_list_dossier
|
||||||
PreferenceListDossier.available_columns.each do |table|
|
PreferenceListDossier.available_columns.each do |table|
|
||||||
table.second.each do |column|
|
table.second.each do |column|
|
||||||
|
@ -47,7 +47,7 @@ class BuildDefaultPreferenceListDossier < ActiveRecord::Migration
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class PreferenceListDossier < ActiveRecord::Base
|
class PreferenceListDossier < ApplicationRecord
|
||||||
def self.available_columns
|
def self.available_columns
|
||||||
{
|
{
|
||||||
dossier: columns_dossier,
|
dossier: columns_dossier,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class FixDefaultTypeOnTypeDeChampTable < ActiveRecord::Migration
|
class FixDefaultTypeOnTypeDeChampTable < ActiveRecord::Migration
|
||||||
class TypeDeChamp < ActiveRecord::Base
|
class TypeDeChamp < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def up
|
def up
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
class AddTypeAttrInChampTable < ActiveRecord::Migration
|
class AddTypeAttrInChampTable < ActiveRecord::Migration
|
||||||
class TypeDeChamp < ActiveRecord::Base
|
class TypeDeChamp < ApplicationRecord
|
||||||
has_many :champs
|
has_many :champs
|
||||||
end
|
end
|
||||||
|
|
||||||
class Champ < ActiveRecord::Base
|
class Champ < ApplicationRecord
|
||||||
belongs_to :type_de_champ
|
belongs_to :type_de_champ
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class DeleteValueOfFilterProcedure < ActiveRecord::Migration
|
class DeleteValueOfFilterProcedure < ActiveRecord::Migration
|
||||||
class Gestionnaire < ActiveRecord::Base
|
class Gestionnaire < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def change
|
def change
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
class InitiatedAllReceivedMailForProcedure < ActiveRecord::Migration
|
class InitiatedAllReceivedMailForProcedure < ActiveRecord::Migration
|
||||||
class Procedure < ActiveRecord::Base
|
class Procedure < ApplicationRecord
|
||||||
has_one :mail_received
|
has_one :mail_received
|
||||||
end
|
end
|
||||||
|
|
||||||
class MailTemplate < ActiveRecord::Base
|
class MailTemplate < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
class ::MailReceived < MailTemplate
|
class ::MailReceived < MailTemplate
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
class BuildDefaultPrefListDossierProcedure < ActiveRecord::Migration
|
class BuildDefaultPrefListDossierProcedure < ActiveRecord::Migration
|
||||||
class Gestionnaire < ActiveRecord::Base
|
class Gestionnaire < ApplicationRecord
|
||||||
has_many :assign_to, dependent: :destroy
|
has_many :assign_to, dependent: :destroy
|
||||||
has_many :procedures, through: :assign_to
|
has_many :procedures, through: :assign_to
|
||||||
has_many :preference_list_dossiers
|
has_many :preference_list_dossiers
|
||||||
end
|
end
|
||||||
|
|
||||||
class PreferenceListDossier < ActiveRecord::Base
|
class PreferenceListDossier < ApplicationRecord
|
||||||
belongs_to :gestionnaire
|
belongs_to :gestionnaire
|
||||||
belongs_to :procedure
|
belongs_to :procedure
|
||||||
end
|
end
|
||||||
|
|
||||||
class AssignTo < ActiveRecord::Base
|
class AssignTo < ApplicationRecord
|
||||||
belongs_to :procedure
|
belongs_to :procedure
|
||||||
belongs_to :gestionnaire
|
belongs_to :gestionnaire
|
||||||
end
|
end
|
||||||
|
|
||||||
class Procedure < ActiveRecord::Base
|
class Procedure < ApplicationRecord
|
||||||
has_many :gestionnaires, through: :assign_to
|
has_many :gestionnaires, through: :assign_to
|
||||||
has_many :preference_list_dossiers
|
has_many :preference_list_dossiers
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class ChangeEmptytoNilInPreferenceListDossierTable < ActiveRecord::Migration
|
class ChangeEmptytoNilInPreferenceListDossierTable < ActiveRecord::Migration
|
||||||
class PreferenceListDossier < ActiveRecord::Base
|
class PreferenceListDossier < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def change
|
def change
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class FixTypeDeChampHeaderSectionWithMandatoryTrue < ActiveRecord::Migration
|
class FixTypeDeChampHeaderSectionWithMandatoryTrue < ActiveRecord::Migration
|
||||||
class TypeDeChamp < ActiveRecord::Base
|
class TypeDeChamp < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def change
|
def change
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class PurgeDraftDossier < ActiveRecord::Migration
|
class PurgeDraftDossier < ActiveRecord::Migration
|
||||||
class Dossier < ActiveRecord::Base
|
class Dossier < ApplicationRecord
|
||||||
BROUILLON = %w(draft)
|
BROUILLON = %w(draft)
|
||||||
|
|
||||||
def brouillon?
|
def brouillon?
|
||||||
|
@ -7,11 +7,11 @@ class PurgeDraftDossier < ActiveRecord::Migration
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class Commentaire < ActiveRecord::Base
|
class Commentaire < ApplicationRecord
|
||||||
belongs_to :dossier
|
belongs_to :dossier
|
||||||
end
|
end
|
||||||
|
|
||||||
class Cerfa < ActiveRecord::Base
|
class Cerfa < ApplicationRecord
|
||||||
belongs_to :dossier
|
belongs_to :dossier
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class ResetAllPreferenceListDossier < ActiveRecord::Migration
|
class ResetAllPreferenceListDossier < ActiveRecord::Migration
|
||||||
class PreferenceListDossier < ActiveRecord::Base
|
class PreferenceListDossier < ApplicationRecord
|
||||||
belongs_to :gestionnaire
|
belongs_to :gestionnaire
|
||||||
belongs_to :procedure
|
belongs_to :procedure
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ class ResetAllPreferenceListDossier < ActiveRecord::Migration
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class Gestionnaire < ActiveRecord::Base
|
class Gestionnaire < ApplicationRecord
|
||||||
has_many :assign_to, dependent: :destroy
|
has_many :assign_to, dependent: :destroy
|
||||||
has_many :procedures, through: :assign_to
|
has_many :procedures, through: :assign_to
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ class ResetAllPreferenceListDossier < ActiveRecord::Migration
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class Procedure < ActiveRecord::Base
|
class Procedure < ApplicationRecord
|
||||||
has_many :assign_to, dependent: :destroy
|
has_many :assign_to, dependent: :destroy
|
||||||
has_many :gestionnaires, through: :assign_to
|
has_many :gestionnaires, through: :assign_to
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class CreatePreferenceSmartListingPage < ActiveRecord::Migration
|
class CreatePreferenceSmartListingPage < ActiveRecord::Migration
|
||||||
class Gestionnaire < ActiveRecord::Base
|
class Gestionnaire < ApplicationRecord
|
||||||
has_one :preference_smart_listing_page, dependent: :destroy
|
has_one :preference_smart_listing_page, dependent: :destroy
|
||||||
|
|
||||||
def build_default_preferences_smart_listing_page
|
def build_default_preferences_smart_listing_page
|
||||||
|
@ -7,7 +7,7 @@ class CreatePreferenceSmartListingPage < ActiveRecord::Migration
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class PreferenceSmartListingPage < ActiveRecord::Base
|
class PreferenceSmartListingPage < ApplicationRecord
|
||||||
belongs_to :gestionnaire
|
belongs_to :gestionnaire
|
||||||
belongs_to :procedure
|
belongs_to :procedure
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ namespace :'2017_07_26_clean_birthdate_on_individual' do
|
||||||
puts "cleaning #{i.birthdate}"
|
puts "cleaning #{i.birthdate}"
|
||||||
new_date = Date.strptime(i.birthdate, "%d/%m/%y")
|
new_date = Date.strptime(i.birthdate, "%d/%m/%y")
|
||||||
if new_date.year > 2017
|
if new_date.year > 2017
|
||||||
new_date = new_date - 100.year
|
new_date = new_date - 100.years
|
||||||
end
|
end
|
||||||
i.update(birthdate: new_date.iso8601)
|
i.update(birthdate: new_date.iso8601)
|
||||||
end
|
end
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace :'2017_10_30_copy_commentaire_piece_justificative_to_file' do
|
||||||
end
|
end
|
||||||
|
|
||||||
commentaire.save
|
commentaire.save
|
||||||
if !commentaire.file.present?
|
if commentaire.file.blank?
|
||||||
puts "Failed to save file for commentaire #{commentaire.id}"
|
puts "Failed to save file for commentaire #{commentaire.id}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -105,7 +105,7 @@ namespace :cloudstorage do
|
||||||
|
|
||||||
@cont.objects_detail.each { |object, details|
|
@cont.objects_detail.each { |object, details|
|
||||||
last_modified = DateTime.parse(details[:last_modified])
|
last_modified = DateTime.parse(details[:last_modified])
|
||||||
@cont.delete_object(object) if last_modified.utc <= (Time.now - 2.year).utc
|
@cont.delete_object(object) if last_modified.utc <= (Time.now - 2.years).utc
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -112,7 +112,7 @@ describe Admin::GestionnairesController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when an other admin will add the same email' do
|
context 'when an other admin will add the same email' do
|
||||||
let(:gestionnaire) { Gestionnaire.find_by_email(email) }
|
let(:gestionnaire) { Gestionnaire.find_by(email: email) }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
create :gestionnaire, email: email, administrateurs: [admin]
|
create :gestionnaire, email: email, administrateurs: [admin]
|
||||||
|
@ -133,7 +133,7 @@ describe Admin::GestionnairesController, type: :controller do
|
||||||
|
|
||||||
context 'when an other admin will add the same email with some uppercase in it' do
|
context 'when an other admin will add the same email with some uppercase in it' do
|
||||||
let(:email) { 'Test@Plop.com' }
|
let(:email) { 'Test@Plop.com' }
|
||||||
let(:gestionnaire) { Gestionnaire.find_by_email(email.downcase) }
|
let(:gestionnaire) { Gestionnaire.find_by(email: email.downcase) }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
create :gestionnaire, email: email, administrateurs: [admin]
|
create :gestionnaire, email: email, administrateurs: [admin]
|
||||||
|
|
|
@ -333,9 +333,9 @@ describe API::V1::DossiersController do
|
||||||
|
|
||||||
it { expect(subject[:created_at]).not_to be_nil }
|
it { expect(subject[:created_at]).not_to be_nil }
|
||||||
if Features.remote_storage
|
if Features.remote_storage
|
||||||
it { expect(subject[:content_url]).to match /^https:\/\/storage.apientreprise.fr\/tps_dev\/cerfa-.*\.pdf$/ }
|
it { expect(subject[:content_url]).to match(/^https:\/\/storage.apientreprise.fr\/tps_dev\/cerfa-.*\.pdf$/) }
|
||||||
else
|
else
|
||||||
it { expect(subject[:content_url]).to match /^http:\/\/.*downloads.*_CERFA\.pdf$/ }
|
it { expect(subject[:content_url]).to match(/^http:\/\/.*downloads.*_CERFA\.pdf$/) }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'user' do
|
describe 'user' do
|
||||||
|
|
|
@ -254,9 +254,9 @@ describe NewGestionnaire::ProceduresController, type: :controller do
|
||||||
|
|
||||||
describe 'statut' do
|
describe 'statut' do
|
||||||
let!(:a_suivre__dossier) { Timecop.freeze(1.day.ago){ create(:dossier, procedure: procedure, state: 'en_instruction') } }
|
let!(:a_suivre__dossier) { Timecop.freeze(1.day.ago){ create(:dossier, procedure: procedure, state: 'en_instruction') } }
|
||||||
let!(:new_followed_dossier) { Timecop.freeze(2.day.ago){ create(:dossier, procedure: procedure, state: 'en_instruction') } }
|
let!(:new_followed_dossier) { Timecop.freeze(2.days.ago){ create(:dossier, procedure: procedure, state: 'en_instruction') } }
|
||||||
let!(:termine_dossier) { Timecop.freeze(3.day.ago){ create(:dossier, procedure: procedure, state: 'accepte') } }
|
let!(:termine_dossier) { Timecop.freeze(3.days.ago){ create(:dossier, procedure: procedure, state: 'accepte') } }
|
||||||
let!(:archived_dossier) { Timecop.freeze(4.day.ago){ create(:dossier, procedure: procedure, state: 'en_instruction', archived: true) } }
|
let!(:archived_dossier) { Timecop.freeze(4.days.ago){ create(:dossier, procedure: procedure, state: 'en_instruction', archived: true) } }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
gestionnaire.followed_dossiers << new_followed_dossier
|
gestionnaire.followed_dossiers << new_followed_dossier
|
||||||
|
|
|
@ -45,7 +45,7 @@ describe StatsController, type: :controller do
|
||||||
it do
|
it do
|
||||||
expect(subject).to eq([
|
expect(subject).to eq([
|
||||||
[I18n.l(45.days.ago.beginning_of_month, format: "%B %Y"), 1],
|
[I18n.l(45.days.ago.beginning_of_month, format: "%B %Y"), 1],
|
||||||
[I18n.l(1.days.ago.beginning_of_month, format: "%B %Y"), 2]
|
[I18n.l(1.day.ago.beginning_of_month, format: "%B %Y"), 2]
|
||||||
])
|
])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -72,7 +72,7 @@ describe StatsController, type: :controller do
|
||||||
|
|
||||||
it do
|
it do
|
||||||
expect(subject).to eq({
|
expect(subject).to eq({
|
||||||
2.month.ago.beginning_of_month => 2,
|
2.months.ago.beginning_of_month => 2,
|
||||||
1.month.ago.beginning_of_month => 4,
|
1.month.ago.beginning_of_month => 4,
|
||||||
1.hour.ago.beginning_of_month => 5
|
1.hour.ago.beginning_of_month => 5
|
||||||
})
|
})
|
||||||
|
@ -86,7 +86,7 @@ describe StatsController, type: :controller do
|
||||||
|
|
||||||
it do
|
it do
|
||||||
expect(subject).to eq({
|
expect(subject).to eq({
|
||||||
2.month.ago.beginning_of_month => 2,
|
2.months.ago.beginning_of_month => 2,
|
||||||
1.month.ago.beginning_of_month => 4
|
1.month.ago.beginning_of_month => 4
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
@ -151,22 +151,22 @@ describe StatsController, type: :controller do
|
||||||
dossier_p1_b = FactoryBot.create(:dossier,
|
dossier_p1_b = FactoryBot.create(:dossier,
|
||||||
:procedure => procedure_1,
|
:procedure => procedure_1,
|
||||||
:en_construction_at => 2.months.ago.beginning_of_month,
|
:en_construction_at => 2.months.ago.beginning_of_month,
|
||||||
:processed_at => 2.months.ago.beginning_of_month + 1.days)
|
:processed_at => 2.months.ago.beginning_of_month + 1.day)
|
||||||
dossier_p1_c = FactoryBot.create(:dossier,
|
dossier_p1_c = FactoryBot.create(:dossier,
|
||||||
:procedure => procedure_1,
|
:procedure => procedure_1,
|
||||||
:en_construction_at => 1.months.ago.beginning_of_month,
|
:en_construction_at => 1.month.ago.beginning_of_month,
|
||||||
:processed_at => 1.months.ago.beginning_of_month + 5.days)
|
:processed_at => 1.month.ago.beginning_of_month + 5.days)
|
||||||
dossier_p2_a = FactoryBot.create(:dossier,
|
dossier_p2_a = FactoryBot.create(:dossier,
|
||||||
:procedure => procedure_2,
|
:procedure => procedure_2,
|
||||||
:en_construction_at => 2.month.ago.beginning_of_month,
|
:en_construction_at => 2.months.ago.beginning_of_month,
|
||||||
:processed_at => 2.month.ago.beginning_of_month + 4.days)
|
:processed_at => 2.months.ago.beginning_of_month + 4.days)
|
||||||
|
|
||||||
# Write directly in the DB to avoid the before_validation hook
|
# Write directly in the DB to avoid the before_validation hook
|
||||||
Dossier.update_all(state: "accepte")
|
Dossier.update_all(state: "accepte")
|
||||||
|
|
||||||
@expected_hash = {
|
@expected_hash = {
|
||||||
"#{2.months.ago.beginning_of_month}" => 3.0,
|
"#{2.months.ago.beginning_of_month}" => 3.0,
|
||||||
"#{1.months.ago.beginning_of_month}" => 5.0
|
"#{1.month.ago.beginning_of_month}" => 5.0
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -204,21 +204,21 @@ describe StatsController, type: :controller do
|
||||||
:processed_at => 2.months.ago.beginning_of_month + 1.day)
|
:processed_at => 2.months.ago.beginning_of_month + 1.day)
|
||||||
dossier_p1_c = FactoryBot.create(:dossier,
|
dossier_p1_c = FactoryBot.create(:dossier,
|
||||||
:procedure => procedure_1,
|
:procedure => procedure_1,
|
||||||
:created_at => 1.months.ago.beginning_of_month,
|
:created_at => 1.month.ago.beginning_of_month,
|
||||||
:en_construction_at => 1.months.ago.beginning_of_month + 50.minutes,
|
:en_construction_at => 1.month.ago.beginning_of_month + 50.minutes,
|
||||||
:processed_at => 1.months.ago.beginning_of_month + 1.day)
|
:processed_at => 1.month.ago.beginning_of_month + 1.day)
|
||||||
dossier_p2_a = FactoryBot.create(:dossier,
|
dossier_p2_a = FactoryBot.create(:dossier,
|
||||||
:procedure => procedure_2,
|
:procedure => procedure_2,
|
||||||
:created_at => 2.month.ago.beginning_of_month,
|
:created_at => 2.months.ago.beginning_of_month,
|
||||||
:en_construction_at => 2.month.ago.beginning_of_month + 80.minutes,
|
:en_construction_at => 2.months.ago.beginning_of_month + 80.minutes,
|
||||||
:processed_at => 2.month.ago.beginning_of_month + 1.day)
|
:processed_at => 2.months.ago.beginning_of_month + 1.day)
|
||||||
|
|
||||||
# Write directly in the DB to avoid the before_validation hook
|
# Write directly in the DB to avoid the before_validation hook
|
||||||
Dossier.update_all(state: "accepte")
|
Dossier.update_all(state: "accepte")
|
||||||
|
|
||||||
@expected_hash = {
|
@expected_hash = {
|
||||||
"#{2.months.ago.beginning_of_month}" => 30.0,
|
"#{2.months.ago.beginning_of_month}" => 30.0,
|
||||||
"#{1.months.ago.beginning_of_month}" => 50.0
|
"#{1.month.ago.beginning_of_month}" => 50.0
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -239,7 +239,7 @@ describe StatsController, type: :controller do
|
||||||
|
|
||||||
subject { StatsController.new.send(:avis_usage) }
|
subject { StatsController.new.send(:avis_usage) }
|
||||||
|
|
||||||
it { expect(subject).to match([[3.week.ago.to_i, 0], [2.week.ago.to_i, 0], [1.week.ago.to_i, 33.33]]) }
|
it { expect(subject).to match([[3.weeks.ago.to_i, 0], [2.weeks.ago.to_i, 0], [1.week.ago.to_i, 33.33]]) }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#avis_average_answer_time" do
|
describe "#avis_average_answer_time" do
|
||||||
|
@ -251,10 +251,10 @@ describe StatsController, type: :controller do
|
||||||
create(:avis, created_at: 1.week.ago + 2.days)
|
create(:avis, created_at: 1.week.ago + 2.days)
|
||||||
|
|
||||||
# 2 weeks ago
|
# 2 weeks ago
|
||||||
create(:avis, answer: "voila ma réponse", created_at: 2.week.ago + 1.day, updated_at: 2.week.ago + 2.days) # 1 day
|
create(:avis, answer: "voila ma réponse", created_at: 2.weeks.ago + 1.day, updated_at: 2.weeks.ago + 2.days) # 1 day
|
||||||
create(:avis, answer: "voila ma réponse2", created_at: 2.week.ago + 3.days, updated_at: 1.week.ago + 6.days) # 10 days
|
create(:avis, answer: "voila ma réponse2", created_at: 2.weeks.ago + 3.days, updated_at: 1.week.ago + 6.days) # 10 days
|
||||||
create(:avis, answer: "voila ma réponse2", created_at: 2.week.ago + 2.days, updated_at: 1.week.ago + 6.days) # 11 days
|
create(:avis, answer: "voila ma réponse2", created_at: 2.weeks.ago + 2.days, updated_at: 1.week.ago + 6.days) # 11 days
|
||||||
create(:avis, created_at: 2.week.ago + 1.day, updated_at: 2.week.ago + 2.days)
|
create(:avis, created_at: 2.weeks.ago + 1.day, updated_at: 2.weeks.ago + 2.days)
|
||||||
|
|
||||||
# 3 weeks ago
|
# 3 weeks ago
|
||||||
create(:avis, answer: "voila ma réponse2", created_at: 3.weeks.ago + 1.day, updated_at: 3.weeks.ago + 2.days) # 1 day
|
create(:avis, answer: "voila ma réponse2", created_at: 3.weeks.ago + 1.day, updated_at: 3.weeks.ago + 2.days) # 1 day
|
||||||
|
@ -267,8 +267,8 @@ describe StatsController, type: :controller do
|
||||||
|
|
||||||
it { expect(subject.count).to eq(3) }
|
it { expect(subject.count).to eq(3) }
|
||||||
it { is_expected.to include [1.week.ago.to_i, 1.0] }
|
it { is_expected.to include [1.week.ago.to_i, 1.0] }
|
||||||
it { is_expected.to include [2.week.ago.to_i, 7.33] }
|
it { is_expected.to include [2.weeks.ago.to_i, 7.33] }
|
||||||
it { is_expected.to include [3.week.ago.to_i, 9.5] }
|
it { is_expected.to include [3.weeks.ago.to_i, 9.5] }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#avis_answer_percentages' do
|
describe '#avis_answer_percentages' do
|
||||||
|
@ -281,7 +281,7 @@ describe StatsController, type: :controller do
|
||||||
before { Timecop.freeze(Time.now) }
|
before { Timecop.freeze(Time.now) }
|
||||||
after { Timecop.return }
|
after { Timecop.return }
|
||||||
|
|
||||||
it { is_expected.to match [[3.week.ago.to_i, 0], [2.week.ago.to_i, 0], [1.week.ago.to_i, 66.67]] }
|
it { is_expected.to match [[3.weeks.ago.to_i, 0], [2.weeks.ago.to_i, 0], [1.week.ago.to_i, 66.67]] }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#motivation_usage_dossier' do
|
describe '#motivation_usage_dossier' do
|
||||||
|
@ -294,7 +294,7 @@ describe StatsController, type: :controller do
|
||||||
|
|
||||||
subject { StatsController.new.send(:motivation_usage_dossier) }
|
subject { StatsController.new.send(:motivation_usage_dossier) }
|
||||||
|
|
||||||
it { expect(subject).to match([[I18n.l(3.week.ago.end_of_week, format: '%d/%m/%Y'), 0], [I18n.l(2.week.ago.end_of_week, format: '%d/%m/%Y'), 0], [I18n.l(1.week.ago.end_of_week, format: '%d/%m/%Y'), 33.33]]) }
|
it { expect(subject).to match([[I18n.l(3.weeks.ago.end_of_week, format: '%d/%m/%Y'), 0], [I18n.l(2.weeks.ago.end_of_week, format: '%d/%m/%Y'), 0], [I18n.l(1.week.ago.end_of_week, format: '%d/%m/%Y'), 33.33]]) }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#motivation_usage_procedure' do
|
describe '#motivation_usage_procedure' do
|
||||||
|
@ -308,6 +308,6 @@ describe StatsController, type: :controller do
|
||||||
|
|
||||||
subject { StatsController.new.send(:motivation_usage_procedure) }
|
subject { StatsController.new.send(:motivation_usage_procedure) }
|
||||||
|
|
||||||
it { expect(subject).to match([[I18n.l(3.week.ago.end_of_week, format: '%d/%m/%Y'), 0], [I18n.l(2.week.ago.end_of_week, format: '%d/%m/%Y'), 0], [I18n.l(1.week.ago.end_of_week, format: '%d/%m/%Y'), 33.33]]) }
|
it { expect(subject).to match([[I18n.l(3.weeks.ago.end_of_week, format: '%d/%m/%Y'), 0], [I18n.l(2.weeks.ago.end_of_week, format: '%d/%m/%Y'), 0], [I18n.l(1.week.ago.end_of_week, format: '%d/%m/%Y'), 33.33]]) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -376,7 +376,7 @@ shared_examples 'description_controller_spec' do
|
||||||
|
|
||||||
it { expect(dossier.pieces_justificatives.size).to eq 2 }
|
it { expect(dossier.pieces_justificatives.size).to eq 2 }
|
||||||
it { expect(flash[:notice]).to be_present }
|
it { expect(flash[:notice]).to be_present }
|
||||||
it { is_expected.to redirect_to users_dossiers_invite_path(id: guest.invites.find_by_dossier_id(dossier.id).id) }
|
it { is_expected.to redirect_to users_dossiers_invite_path(id: guest.invites.find_by(dossier_id: dossier.id).id) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -396,7 +396,7 @@ shared_examples 'description_controller_spec' do
|
||||||
|
|
||||||
it { expect(dossier.pieces_justificatives.size).to eq 4 }
|
it { expect(dossier.pieces_justificatives.size).to eq 4 }
|
||||||
it { expect(flash[:notice]).to be_present }
|
it { expect(flash[:notice]).to be_present }
|
||||||
it { is_expected.to redirect_to users_dossiers_invite_path(id: guest.invites.find_by_dossier_id(dossier.id).id) }
|
it { is_expected.to redirect_to users_dossiers_invite_path(id: guest.invites.find_by(dossier_id: dossier.id).id) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -413,7 +413,7 @@ shared_examples 'description_controller_spec' do
|
||||||
|
|
||||||
it { expect(dossier.pieces_justificatives.size).to eq 1 }
|
it { expect(dossier.pieces_justificatives.size).to eq 1 }
|
||||||
it { expect(flash[:alert]).to be_present }
|
it { expect(flash[:alert]).to be_present }
|
||||||
it { is_expected.to redirect_to users_dossiers_invite_path(id: guest.invites.find_by_dossier_id(dossier.id).id) }
|
it { is_expected.to redirect_to users_dossiers_invite_path(id: guest.invites.find_by(dossier_id: dossier.id).id) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -85,7 +85,7 @@ FactoryBot.define do
|
||||||
after(:create) do |dossier, _evaluator|
|
after(:create) do |dossier, _evaluator|
|
||||||
dossier.state = 'en_instruction'
|
dossier.state = 'en_instruction'
|
||||||
dossier.en_construction_at = dossier.created_at + 1.minute
|
dossier.en_construction_at = dossier.created_at + 1.minute
|
||||||
dossier.created_at = dossier.created_at + 2.minute
|
dossier.created_at = dossier.created_at + 2.minutes
|
||||||
dossier.save!
|
dossier.save!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -31,9 +31,7 @@ RSpec.describe AutoArchiveProcedureJob, type: :job do
|
||||||
before do
|
before do
|
||||||
subject
|
subject
|
||||||
|
|
||||||
(1..9).each do |i|
|
[dossier1, dossier2, dossier3, dossier4, dossier5, dossier6, dossier7, dossier8, dossier9].each(&:reload)
|
||||||
eval "dossier#{i}.reload"
|
|
||||||
end
|
|
||||||
|
|
||||||
procedure_hier.reload
|
procedure_hier.reload
|
||||||
procedure_aujourdhui.reload
|
procedure_aujourdhui.reload
|
||||||
|
|
|
@ -245,9 +245,9 @@ describe Procedure do
|
||||||
|
|
||||||
it { expect(procedure.archived_at).to eq(nil) }
|
it { expect(procedure.archived_at).to eq(nil) }
|
||||||
it { expect(procedure.published_at).to eq(now) }
|
it { expect(procedure.published_at).to eq(now) }
|
||||||
it { expect(ProcedurePath.find_by_path("example-path")).to be }
|
it { expect(ProcedurePath.find_by(path: "example-path")).to be }
|
||||||
it { expect(ProcedurePath.find_by_path("example-path").procedure).to eq(procedure) }
|
it { expect(ProcedurePath.find_by(path: "example-path").procedure).to eq(procedure) }
|
||||||
it { expect(ProcedurePath.find_by_path("example-path").administrateur).to eq(procedure.administrateur) }
|
it { expect(ProcedurePath.find_by(path: "example-path").administrateur).to eq(procedure.administrateur) }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#brouillon?" do
|
describe "#brouillon?" do
|
||||||
|
|
|
@ -52,8 +52,8 @@ Capybara.default_max_wait_time = 1
|
||||||
|
|
||||||
# Requires supporting ruby files with custom matchers and macros, etc,
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
||||||
# in spec/support/ and its subdirectories.
|
# in spec/support/ and its subdirectories.
|
||||||
Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
|
Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each { |f| require f }
|
||||||
Dir[Rails.root.join('spec/factories/**/*.rb')].each { |f| require f }
|
Dir[Rails.root.join('spec', 'factories', '**', '*.rb')].each { |f| require f }
|
||||||
|
|
||||||
# Checks for pending migrations before tests are run.
|
# Checks for pending migrations before tests are run.
|
||||||
# If you are not using ActiveRecord, you can remove this line.
|
# If you are not using ActiveRecord, you can remove this line.
|
||||||
|
|
Loading…
Add table
Reference in a new issue