Commits on Mar 14, 2018
  1. Merge pull request #423 from tbrisker/470

    danielmorrison committed Mar 14, 2018
    Prepare for 4.7.0 release
  2. Prepare for 4.7.0 release

    tbrisker committed Mar 13, 2018
  3. Fix RSpec matchers along with a few other things. (#420)

    hernanat authored and tbrisker committed Mar 14, 2018
    This commit fixes issues with the RSpec matchers, notably:
    - For the `except` matcher code path, `model_class.default_ignored_attributes` was being called, but that method was made protected in a previous change as discussed [here](8f8495d#commitcomment-28001384). This commit makes that method public again.
    - Both the `on` and `except` matcher options have undergone a pretty substantial refactor. As I was fixing the original issue with `on` and `except`, I started to notice other things and addressed them. I will try to make explanatory comments on the PR to give some insight.
    - The matchers as a whole have undergone pretty significant changes, and I found that many of them were not working as intended, or, for example, in the case of `on`, it was a no-op. I made the changes that I thought reflected what the matchers ought to do and I also included tests (which actually ended up being extremely useful in discovering some of the bugs!) to make sure that future changes don't break anything.
    - The `requires_comment` matcher's behavior has changed to look for callbacks instead. I also changed the way that comment-required state validity is checked in the `Auditor`, but I will discuss that below. My reasoning for the two changes are related though - given an audited model where audit comments are required, we only care about the existence of the comment when an object is being created, if it has been changed (and subsequently updated), or if it is about to be destroyed (and of course we can include & exclude any combination of these three states with the `on` option). Previously, the presence of the comment was related to the overall state of the object itself, and I found this confusing since the comment only matters when we are _doing_ something to the object.
    - I have decoupled the codepaths for each option so that they could be run independently of one another (and all together, of course). I was getting some interesting behavior before, but I believe I have nailed down the correct behavior.
    - I will discuss anything not discussed above for the matchers in PR comments.
    The `Auditor` itself:
    - Changed the way non-audited columns were calculated. Will discuss in-line.
    - Revised and (hopefully) simplified the way that audit comments are required & validated. Will discuss in-line.
    Other comments:
    - As I mentioned above, I noticed some behavioral issues that I tried to address. I will talk about them more in-line and if there are any questions about particular things I did please feel free to ask.
    - Another thing I would like to do is a complete rework of the test suite itself (or if anyone else wants to take this up, feel free :P) In writing the tests for the matchers, I noticed many things such as audited columns for the `User` model being inconsistent, the `Audited.ignored_attributes` changing, and more. This is directly caused by the behavior of some of the tests, and I think it would be beneficial to figure out a way to rework the behavior such that what happens in one test doesn't have an impact on all the others. I also have a slight fear that some tests may in fact be returning false-positives, but I haven't looked too far into that yet.
    - I was wondering if it would be better to not memoize `Auditor#audited_columns` and `Auditor#non_audited_columns` since the calculations are not really intensive enough to warrant memoization, but when I did that tests were breaking left and right and so I think this really ties into my point above about the test suite. Something to keep in mind / look into. I didn't do it in this PR because there is already quite a bit going on.
Commits on Mar 13, 2018
Commits on Mar 12, 2018
  1. Allow limiting number of audits stored (#405)

    fatkodima authored and tbrisker committed Mar 12, 2018
    Adds a setting to allow limiting the maximum number of audits per object.
    Fixes #274
Commits on Mar 11, 2018
  1. Add conditional and exclusionary auditing feature

    Valentino authored and tbrisker committed Feb 6, 2014
    * Adds conditional (:if) and exclusionary (:unless) auditing feature
    * Updates docs for `audited` to reflect new features
    Upstream #167
Commits on Mar 8, 2018
Commits on Feb 26, 2018
  1. Update Ruby versions in README

    lmansur authored and tbrisker committed Feb 25, 2018
Commits on Feb 25, 2018
  1. Add inverse_of to audit relation

    tbrisker committed Feb 15, 2018
    This allows access to the audited object's relations from inside audits
    without reloading it from the database. This is useful, for example, if
    you want to check has_many relations which are deleted from the database
    before the audit callback is executed.
  2. Update Ruby versions in travis.yml

    lmansur authored and tbrisker committed Feb 24, 2018
Commits on Feb 1, 2018
Commits on Jan 31, 2018
Commits on Jan 30, 2018
  1. Remove references to removed allow_mass_assigment

    tekin authored and tbrisker committed Jan 18, 2018
    As pointed out in issue #223, allow_mass_assigment has been removed and
    no longer has any effect. This updates the docs to no longer talk about
    it as it causes confusion to users of the gem.
Commits on Jan 16, 2018
  1. Merge pull request #404 from fatkodima/ci-ruby2.5.0

    tbrisker committed Jan 16, 2018
    CI against ruby 2.5.0
Commits on Jan 15, 2018
  1. CI against ruby 2.5.0

    fatkodima committed Jan 15, 2018
  2. Merge pull request #402 from fatkodima/optimize-revisions

    tbrisker committed Jan 15, 2018
    Reduce db calls in #revisions method
Commits on Jan 9, 2018
  1. Merge pull request #400 from tbrisker/v46

    danielmorrison committed Jan 9, 2018
    Prepare for 4.6.0 release
  2. Update Changelog

    tbrisker committed Jan 9, 2018
  3. Return nil on invalid revision number (#384)

    JonathanWThom authored and tbrisker committed Jan 9, 2018
    Previously, when a `record.revision(version)` was called
    with a version number that was greater than the total
    number of revisions, it would return the last revision
    in the list. This changes it to return nil.
  4. Normalize options on initialization and minor cleanup

    tbrisker committed Jan 7, 2018
    Normalizing options passed on audited initialization simplifies code in
    further steps. Also cleaned up the code a bit.
Commits on Jan 7, 2018
Commits on Jan 1, 2018
  1. Merge pull request #389 from tbrisker/auditedchanges

    tbrisker committed Jan 1, 2018
    Simplify audited_changes
Commits on Dec 31, 2017
  1. Merge pull request #365 from printercu/patch-1

    tbrisker committed Dec 31, 2017
    Remove duplicated method
  2. Merge pull request #386 from lostapathy/update_rubies

    tbrisker committed Dec 31, 2017
    update travis config to latest rubies
  3. update to latest rubies

    lostapathy authored and tbrisker committed Nov 13, 2017
  4. Simplify audited_changes

    tbrisker committed Dec 3, 2017
    `changes` (or `changes_to_save` in Rails>5.1) already gives us all the
    changes in the format we need for saving the audit, no need to build
    the hash again by ourselves.
Commits on Dec 30, 2017
  1. Merge pull request #381 from arcticbarra/undo

    danielmorrison committed Dec 30, 2017
    Add support for undoing changes
  2. Merge pull request #390 from tbrisker/rakespec

    danielmorrison committed Dec 30, 2017
    Require bundler in spec_helper
  3. Merge pull request #385 from olegykz/master

    danielmorrison committed Dec 30, 2017
    Columns order adjustment for polymorphic indexes
  4. Merge pull request #391 from tbrisker/auditedcolumns

    danielmorrison committed Dec 30, 2017
    Simplify audited_columns
  5. Merge pull request #388 from mrhead/prepare-for-rails-5-2

    danielmorrison committed Dec 30, 2017
    Add tests for Rails 5.2