Jared Beck
6a91c73d46
Deprecate PaperTrail.serialized_attributes?
...
This is a follow-up to PR 667
"Use Active Record's type system from 4.2 onwards."
2015-12-22 11:32:50 -05:00
Kasper Timm Hansen
5be48e491e
Use Active Record's type system from 4.2 onwards.
...
Rails 4.2 deprecates `serialized_attributes` without replacement. However,
it also introduces a type system which lets us treat all attributes the same.
Rails 4.2 has `type_for_attribute` which knows how to serialize and deserialize
itself from a database through `type_cast_for_database` and `type_cast_from_database`.
(In Rails 5 they will be `serialize` and `deserialize` respectively.)
Thus we no longer need the `PaperTrail.config.serialized_attributes` toggle,
and this change makes it do nothing. It's still kept around for backwardscompatibility.
2015-12-21 21:06:42 +01:00
Jared Beck
9c6c62d77e
Reduce duplication in Config#enabled
2015-12-13 00:37:26 -05:00
Jared Beck
3a72b7f7c7
Code style: Break long lines
2015-12-13 00:01:40 -05:00
Jared Beck
90dc72cf19
In track_associations, only check db if no config
...
This allows users who need to precompile assets without a database
to configure `track_associations = false`.
See discussion: https://github.com/airblade/paper_trail/issues/636
2015-10-31 22:58:54 -04:00
Jared Beck
748226b9a5
Use ActiveSupport::Deprecation.warn, not Kernel#warn
...
- Provides helpful stack trace
- Can be silenced
- We already have a dependency on activesupport
- Available in all versions of rails we support: 3 - 5
2015-07-13 00:01:00 -04:00
Ben Atkins
797057bc05
Ensure the default serializer is loaded to memory before referencing it in PaperTrail::Config#initialize [ci skip]
2015-06-23 22:26:55 -04:00
Eric Hankins
71faed3a04
Make Config.enabled backed by a thread variable #539
2015-06-03 09:27:57 -05:00
Ben Atkins
5f8904e2ef
re: #501 ; Add config option for tracking associations with a logical default
2015-03-25 19:18:05 -04:00
Ben Atkins
b30b2e86d5
Add config option for enabling/disabling utilization of serialized_attributes
,
...
useful for ActiveRecord 4.2+ where the feature is deprecated.
2014-12-29 14:38:32 -05:00
Ben Atkins
b32ced84c5
Upcasing the provided YAML and JSON serializers
2013-10-17 22:05:24 -04:00
Ben Atkins
dbb4f28325
Add version limit config option. Close #213
2013-05-23 15:56:19 -04:00
Ben Atkins
38e05bc53e
Merge remote-tracking branch 'bradleypriest/master'
...
Conflicts:
lib/paper_trail/has_paper_trail.rb
lib/paper_trail/version.rb
2012-12-28 01:12:42 -05:00
Ben Atkins
28171e15d2
Move singleton requirement to the config class itself since it is the only class which uses the Singleton module.
2012-10-30 16:01:13 -04:00
Bradley Priest
41e255bf51
Add the ability to use a custom serializer for storing the object in the database
2012-10-13 16:08:39 +08:00
Jared Mehle
f8becc65e8
Added ability for user to specify a field_name to use for the version creation timestamp
2012-02-01 13:47:06 -06:00
Andy Stewart
4f4f814500
Global enable/disable for PaperTrail.
...
Thanks to these commits from jeremyw:
* 9254147
* 3748fd3..66463e6
2010-03-19 15:21:07 +00:00