Some minor syntax tweaks, updated CHANGELOG.
This commit is contained in:
parent
fadb1bfc58
commit
0c3f8e42de
|
@ -1,5 +1,6 @@
|
||||||
## 2.7.1 (Unreleased)
|
## 2.7.1 (Unreleased)
|
||||||
|
|
||||||
|
- [#189](https://github.com/airblade/paper_trail/pull/189) - Provided support for a `configure` block initializer.
|
||||||
- Added `setter` method for the `serializer` config option.
|
- Added `setter` method for the `serializer` config option.
|
||||||
|
|
||||||
## 2.7.0
|
## 2.7.0
|
||||||
|
|
|
@ -90,7 +90,7 @@ module PaperTrail
|
||||||
def self.config
|
def self.config
|
||||||
@@config ||= PaperTrail::Config.instance
|
@@config ||= PaperTrail::Config.instance
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.configure
|
def self.configure
|
||||||
yield config
|
yield config
|
||||||
end
|
end
|
||||||
|
|
|
@ -82,7 +82,7 @@ class Version < ActiveRecord::Base
|
||||||
model.class.unserialize_attributes_for_paper_trail attrs
|
model.class.unserialize_attributes_for_paper_trail attrs
|
||||||
attrs.each do |k, v|
|
attrs.each do |k, v|
|
||||||
if model.respond_to?("#{k}=")
|
if model.respond_to?("#{k}=")
|
||||||
model[k] = v
|
model[k.to_sym] = v
|
||||||
else
|
else
|
||||||
logger.warn "Attribute #{k} does not exist on #{item_type} (Version id: #{id})."
|
logger.warn "Attribute #{k} does not exist on #{item_type} (Version id: #{id})."
|
||||||
end
|
end
|
||||||
|
|
|
@ -31,10 +31,9 @@ class SerializerTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
|
|
||||||
# Check values are stored as YAML.
|
# Check values are stored as YAML.
|
||||||
hash = {"widget_id" => nil,"name" =>"Some text.","id" =>1}
|
hash = {"widget_id" => nil, "name" => "Some text.", "id" => 1}
|
||||||
assert_equal YAML.dump(hash), @fluxor.versions[1].object
|
assert_equal YAML.dump(hash), @fluxor.versions[1].object
|
||||||
assert_equal hash, YAML.load(@fluxor.versions[1].object)
|
assert_equal hash, YAML.load(@fluxor.versions[1].object)
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue