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:
Steve Klabnik 2012-05-09 18:51:58 -04:00
parent aac42fcce7
commit b58e7eb963
3 changed files with 5 additions and 4 deletions

View File

@ -6,6 +6,8 @@
* Dropped support for Rubies < 1.9.3
* #to_model has been renamed to #wrapped_object
== 0.12.1
* Added Changelog

View File

@ -191,7 +191,7 @@ module Draper
# Fetch the original wrapped model.
#
# @return [Object] original_model
def to_model
def wrapped_object
@model
end

View File

@ -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