Class: ArDocStore::Attributes::Datetime

Inherits:
Base
  • Object
show all
Defined in:
lib/ar_doc_store/attributes/datetime.rb

Instance Attribute Summary

Attributes inherited from Base

#attribute, #conversion, #default, #model, #options, #predicate

Instance Method Summary collapse

Methods inherited from Base

#add_ransacker, #attribute_options, #build, build, #embedded?, #initialize, #store_attribute

Methods included from CallbackSupport

included

Constructor Details

This class inherits a constructor from ArDocStore::Attributes::Base

Instance Method Details

#attribute_typeObject



16
17
18
# File 'lib/ar_doc_store/attributes/datetime.rb', line 16

def attribute_type
  ActiveRecord::Type::DateTime
end

#define_query_methodObject



4
5
6
7
8
9
10
# File 'lib/ar_doc_store/attributes/datetime.rb', line 4

def define_query_method
  model.class_eval "    def \#{attribute}?\n      \#{attribute}.present?\n    end\n  CODE\nend\n", __FILE__, __LINE__ + 1

#typeObject



12
13
14
# File 'lib/ar_doc_store/attributes/datetime.rb', line 12

def type
  :datetime
end