mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-25 23:33:00 +00:00
methods for validated attributes for write cache and before type cast
cache raw value in @attributes_cache which is AR convention but should work fine with non-AR ORM before type cast method for reading back cached raw value
This commit is contained in:
@@ -25,12 +25,15 @@ LOCALE_PATH = File.expand_path(File.dirname(__FILE__) + '/../lib/validates_timel
|
||||
I18n.load_path.unshift(LOCALE_PATH)
|
||||
|
||||
class Person
|
||||
include ActiveModel::AttributeMethods
|
||||
include ActiveModel::Validations
|
||||
extend ActiveModel::Translation
|
||||
|
||||
attr_accessor :birth_date, :birth_time, :birth_datetime
|
||||
attr_accessor :attributes
|
||||
|
||||
def initialize(attributes = {})
|
||||
@attributes = {}
|
||||
attributes.each do |key, value|
|
||||
send "#{key}=", value
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user