{"record":{"id":"0d93358234983042","repo":"faker-ruby/faker","slug":"from-date-to-date-and-excepted-date-must-not-be-t","errorCode":null,"errorMessage":"From date, to date and excepted date must not be the same","messagePattern":"From date, to date and excepted date must not be the same","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/faker/default/date.rb","lineNumber":45,"sourceCode":"      end\n\n      ##\n      # Produce a random date between two dates.\n      #\n      # @param from [Date, String] The start of the usable date range.\n      # @param to [Date, String] The end of the usable date range.\n      # @param excepted [Date, String] A date to exclude.\n      # @return [Date]\n      #\n      # @example if used with or without Rails (Active Support)\n      #   Faker::Date.between_except(from: '2014-09-23', to: '2015-09-25', excepted: '2015-01-24') #=> #<Date: 2014-10-03>\n      #\n      # @example if used with Rails (Active Support)\n      #   Faker::Date.between_except(from: 1.year.ago, to: 1.year.from_now, excepted: Date.today) #=> #<Date: 2014-10-03>\n      #\n      # @faker.version 1.6.2\n      def between_except(from:, to:, excepted:)\n        raise ArgumentError, 'From date, to date and excepted date must not be the same' if from == to && to == excepted\n\n        excepted = get_date_object(excepted)\n\n        loop do\n          date = between(from: from, to: to)\n          break date.to_date if date != excepted\n        end\n      end\n\n      ##\n      # Produce a random date in the future (up to N days).\n      #\n      # @param from [Integer] The start of the usable forward date range.\n      # @param days [Integer] The maximum number of days to go into the future.\n      # @return [Date]\n      #\n      # @example if used with or without Rails (Active Support)\n      #   Faker::Date.forward(days: 23) #=> #<Date: 2014-10-03>","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/faker-ruby/faker/blob/cca4184947e09fdd02afb8b89d25a9c8ebc7274e/lib/faker/default/date.rb#L27-L63","documentation":"Error \"From date, to date and excepted date must not be the same\" thrown in faker-ruby/faker.","triggerScenarios":"Thrown at lib/faker/default/date.rb:45 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"cca4184947e09fdd02afb8b89d25a9c8ebc7274e","analyzedAt":"2026-08-21T16:25:39.145Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}