Commit Graph

5 Commits

Author SHA1 Message Date
Weston Ganger 02b6de2dac Integrate versioning into AR touch method (#1063)
* integrate versioning into AR touch method

* add touch to list of :on events, deprecate touch_with_version

* integrate versioning into AR touch method
2018-03-16 18:21:45 -04:00
Jared Beck 430738fcee Fix touch_with_version's data_for_update
Fixes https://github.com/airblade/paper_trail/issues/1047

Fixes touch_with_version when the update callback is not installed,
eg. `has_paper_trail(on: [])`
2018-03-04 02:17:22 -05:00
Tyler Rick 3960d7ff75 Add paper_trail.update_columns (#1037)
* Add paper_trail.update_columns

Add paper_trail.update_columns so you can record a version when using
update_columns (which skips all callbacks, including the after_update
callback).

* Change recordable_object_changes to not have a default for the changes
argument so that we don't need an exception to
Style/MethodCallWithoutArgsParentheses

* Add back the duplication between record_update and
record_update_columns, at @jaredbeck's request

* - Add Changelog entry for `paper_trail.update_columns`
- Use a guard in `record_update_columns`
- Use Timecop.freeze so that we can guarantee that an expectation will pass
- Add some comments
2018-01-22 22:21:08 -05:00
Jared Beck cfbf7a647c Lint: Style/FrozenStringLiteralComment 2017-12-10 23:05:39 -05:00
Jared Beck 7295f65a3c Organizing model tests
model_spec is far too long, let's break it up into specs for individual
models in the dummy app.

Extract spec/models/legacy_widget_spec.rb

Extract spec/models/on/empty_array_spec.rb

Extract spec/models/on/create_spec.rb

Extract spec/models/on/update_spec.rb

Extract spec/models/on/destroy_spec.rb

Move an example to config_spec.rb

Extract spec/models/translation_spec.rb

Extract spec/models/article_spec.rb

Move examples to document_spec.rb
2017-07-05 00:15:15 -04:00