Guest User

Untitled

a guest
Jul 21st, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. class MyModel < ActiveRecord::Base
  2. attr_accessor :hidden_ymd, :human_to_date
  3. before_validation :parse_to_date
  4.  
  5. private
  6.  
  7. def parse_to_date
  8. self.toDate = DateTime.parse("#{hidden_ymd} #{human_to_date}")
  9. end
  10. end
Add Comment
Please, Sign In to add comment