File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ def persisted?
16
16
true
17
17
end
18
18
19
- def respond_to? ( message )
19
+ def respond_to? ( message , include_private = false )
20
20
message . to_s =~ /_before_type_cast$/ ? false : super
21
21
end
22
22
end
@@ -100,8 +100,8 @@ def @object.kind_of?(other)
100
100
def @object.instance_of?(other)
101
101
other == #{ model_class }
102
102
end
103
- def @object.respond_to?(method_name)
104
- #{ model_class } .respond_to?(:column_names) && #{ model_class } .column_names.include?(method_name.to_s) || super
103
+ def @object.respond_to?(method_name, include_private=false )
104
+ #{ model_class } .respond_to?(:column_names, include_private ) && #{ model_class } .column_names.include?(method_name.to_s) || super
105
105
end
106
106
def @object.class
107
107
#{ model_class }
Original file line number Diff line number Diff line change 144
144
MockableModel . stub ( :column_names ) . and_return ( [ "column_a" , "column_b" ] )
145
145
@model = mock_model ( MockableModel )
146
146
end
147
+
148
+ it "accepts two arguments" do
149
+ expect do
150
+ @model . respond_to? ( "title_before_type_cast" , false )
151
+ end . to_not raise_exception
152
+ end
153
+
147
154
context "without as_null_object" do
148
155
it "says it will respond_to?(key) if RealModel has the attribute 'key'" do
149
156
@model . respond_to? ( "column_a" ) . should be ( true )
You can’t perform that action at this time.
0 commit comments