Permalink
Commits on Mar 10, 2017
  1. Update thoughtbot logo

    tysongach committed on GitHub Mar 10, 2017
Commits on Feb 6, 2017
  1. Update .rubocop.yml

    Import all of the Rubocop rules from Hound so that the comments that
    Hound produces are the same ones that would be produced in Vim.
    
    [ci skip]
    mcmire committed Feb 6, 2017
Commits on Jan 14, 2017
  1. Add note to README

    [ci skip]
    mcmire committed Jan 14, 2017
Commits on Jan 10, 2017
  1. Bump version to 3.1.2

    geoffharcourt committed Nov 22, 2016
Commits on Jan 9, 2017
Commits on Nov 21, 2016
  1. Fix permit matcher for multiple instances of params

    When the permit matcher is used without `#on`, the controller does
    not use `params#require`, and the params object is duplicated, the
    matcher did not recognize the `#permit` call inside the controller.
    This happened because the matcher overwrote double registries with the
    same parameter hash whenever ActionController::Parameters was
    instantiated.
    This is related to #899.
    aripollak committed with geoffharcourt Feb 11, 2016
Commits on Sep 11, 2016
  1. Correct typo in docs

    A leftover `end` was left from the boilerplate.
    jeroenvisser101 committed with mcmire Apr 13, 2016
Commits on Jun 16, 2016
  1. Take off the 'changing of the guard' note

    [ci skip]
    mcmire committed Jun 16, 2016
  2. Update RSpec test style across docs

    Instead of using
    
        describe Foo do
          # ...
        end
    
    use
    
        RSpec.describe Foo, type: :model do
          # ...
        end
    
    instead. This is not exactly official, as the former style still works,
    but the latter style is highly suggested in RSpec documentation and the
    like, so this is what people are used to.
    
    [ci skip]
    mcmire committed Jun 16, 2016
  3. Make README more specific for new Rspec

    [ci skip]
    Owen Davies committed with mcmire Nov 6, 2015
Commits on Feb 25, 2016
  1. Add note to README about changing maintainership

    [ci skip]
    mcmire committed Feb 25, 2016
Commits on Jan 28, 2016
  1. Bump version to 3.1.1

    mcmire committed Jan 28, 2016
  2. Typo fix

    ojab committed with mcmire Dec 25, 2015
  3. Fix typo

    greysteil committed with mcmire Jan 18, 2016
  4. Update NEWS

    [ci skip]
    mcmire committed Jan 28, 2016
  5. Update NEWS

    [ci skip]
    mcmire committed Jan 28, 2016
  6. Support multiple uniq validations on same attr

    It turns out that you can have multiple uniqueness validations on the
    same attribute. This is useful if you want the attribute to be unique
    under different sets of scopes. For instance:
    
    ```
    class CalibrationConstantVersion < ActiveRecord::Base
      validates_uniqueness_of(
        :calibration_constant,
        scope: [:name]
      )
    
      validates_uniqueness_of(
        :calibration_constant,
        scope: [:begin_at, :physical_device_id]
      )
    end
    ```
    
    So if you have a test like this:
    
    ```
    describe CalibrationConstantVersion do
      it do
        should validate_uniqueness_of(:calibration_constant).
          scoped_to(:name).
          case_insensitive
      end
    
      it do
        should validate_uniqueness_of(:calibration_constant).
          scoped_to(:begin_at, :physical_device_id)
      end
    end
    ```
    
    the first test will fail because the matcher doesn't know that
    :calibration_constant is supposed to be unique relative to :begin_at and
    :physical_device_id, and the second test will fail because it doesn't
    know :calibration_constant is supposed to be unique relative to :name.
    
    Now, in order to properly fix this, we'll need to add another matcher.
    However, for the time being we *can* fix the following case:
    
    ```
    class CalibrationConstantVersion < ActiveRecord::Base
      validates_uniqueness_of(
        :calibration_constant,
        scope: [:name],
        message: 'first message'
      )
    
      validates_uniqueness_of(
        :calibration_constant,
        scope: [:begin_at, :physical_device_id],
        message: 'second message'
      )
    end
    
    describe CalibrationConstantVersion do
      it do
        should validate_uniqueness_of(:calibration_constant).
          scoped_to(:name).
          with_message('first message')
      end
    
      it do
        should validate_uniqueness_of(:calibration_constant).
          scoped_to(:begin_at, :physical_device_id).
          with_message('second message')
      end
    end
    ```
    
    These tests also fail, but for a different reason. One of the checks we
    make is to compare the list of scopes you've provided with the list of
    scopes that are actually on the validation. Notice I said "validation"
    -- we don't expect there to be multiple, we just look for the first
    uniqueness validation that's on the attribute in question. So in this
    case, the first test will pass, but the second test will fail, because
    it thinks all that :calibration_constant is scoped to is :name.
    mcmire committed Jan 28, 2016
  7. uniqueness: Describe all attrs set on new record

    Currently, the failure message for the uniqueness matcher lists the last
    attribute that was set on the new record when it failed validation. This
    is confusing if the matcher is testing scopes because we don't have
    insight into all of the information.
    mcmire committed Jan 25, 2016
  8. Upgrade Rake

    This is necessary in order to use Zeus, since Rake is loaded before
    Bundler (and so if the version of Rake installed locally and the version
    in the Gemfile differ then Bundler will complain).
    mcmire committed Jan 25, 2016
Commits on Jan 18, 2016
  1. Update NEWS

    [ci skip]
    mcmire committed Jan 18, 2016
  2. uniqueness: Guide users to set non-nullable attrs

    When attempting to create an existing record, if the database raises an
    error because a non-nullable column is not set, then capture this error
    and raise a more useful one instead that guides users to provide a
    record where the column is already set.
    mcmire committed Jan 16, 2016
  3. uniqueness: Do not ensure existing record is valid

    Currently, the first thing that the uniqueness matcher does is to check
    to ensure that the record is valid. This creates a problem because if
    the existing record did not exist before and comes from the subject, and
    if the model has required attributes which are not set beforehand or
    has other validations on the attribute being tested, then the record
    will fail validation. Unfortunately, enforcing this will break users'
    tests, so roll back this behavior.
    mcmire committed Jan 16, 2016
Commits on Jan 15, 2016
  1. Fix instructions for Minitest

    [ci skip]
    mcmire committed Jan 15, 2016
Commits on Jan 11, 2016
  1. Update NEWS

    [ci skip]
    mcmire committed Jan 11, 2016
  2. Use #include? instead of #in?

    oogali committed Jan 11, 2016
  3. Bump version to 3.1.0

    mcmire committed Jan 11, 2016
  4. Remove most docs for ignoring_interference_by_writer

    Since `ignoring_interference_by_writer` is on by default now, we don't
    need to explicitly document it (unless someone wants to turn it off, but
    that's unlikely).
    
    [ci skip]
    mcmire committed Jan 11, 2016
  5. Prepare NEWS before release

    [ci skip]
    mcmire committed Jan 11, 2016
  6. (feature): Add 'ignore_case_sensitivity' option

    Fixes #836
    also possibly #838
    ?
    
    The issue is that the existing functionality was either actively
    asserting case sensitivity or case insensitivity. This commit adds an
    option to not assert either.
    
    This allows handling of the scenario where the case of an attribute is
    changed at some point before being assigned on the model.
    dgmstuart committed with mcmire Nov 12, 2015