mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-25 07:16:41 +00:00
fix bug preventing custom class methods on date/times
This commit is contained in:
@@ -137,4 +137,21 @@ describe ValidatesTimeliness::ActiveRecord::AttributeMethods do
|
||||
person.birth_date.should == tomorrow
|
||||
end
|
||||
|
||||
describe "attribute writer" do
|
||||
|
||||
it "should be able to be overridden in class" do
|
||||
Person.class_eval { attr_accessor :birth_date }
|
||||
person = Person.new
|
||||
person.birth_date = 'overriden'
|
||||
person.birth_date.should == 'overriden'
|
||||
end
|
||||
|
||||
after do
|
||||
Person.class_eval do
|
||||
undef_method(:birth_date)
|
||||
undef_method(:birth_date=)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user