Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyModel < ActiveRecord::Base
- attr_accessor :hidden_ymd, :human_to_date
- before_validation :parse_to_date
- private
- def parse_to_date
- self.toDate = DateTime.parse("#{hidden_ymd} #{human_to_date}")
- end
- end
Add Comment
Please, Sign In to add comment