Change #to_model -> #wrapped_object
This is a breaking change, but ActiveModel already uses to_model in a certain way.
This commit is contained in:
parent
aac42fcce7
commit
b58e7eb963
|
@ -6,6 +6,8 @@
|
|||
|
||||
* Dropped support for Rubies < 1.9.3
|
||||
|
||||
* #to_model has been renamed to #wrapped_object
|
||||
|
||||
== 0.12.1
|
||||
|
||||
* Added Changelog
|
||||
|
|
|
@ -191,7 +191,7 @@ module Draper
|
|||
# Fetch the original wrapped model.
|
||||
#
|
||||
# @return [Object] original_model
|
||||
def to_model
|
||||
def wrapped_object
|
||||
@model
|
||||
end
|
||||
|
||||
|
|
|
@ -182,10 +182,9 @@ describe Draper::Base do
|
|||
end
|
||||
end
|
||||
|
||||
context(".model / .to_model") do
|
||||
context(".wrapped_object") do
|
||||
it "should return the wrapped object" do
|
||||
subject.to_model.should == source
|
||||
subject.model.should == source
|
||||
subject.wrapped_object.should == source
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue