Class: ArDocStore::Attributes::Array
- Inherits:
-
Base
- Object
- Base
- ArDocStore::Attributes::Array
show all
- Defined in:
- lib/ar_doc_store/attributes/array.rb
Instance Attribute Summary
Attributes inherited from Base
#attribute, #conversion, #default, #model, #options, #predicate
Instance Method Summary
collapse
Methods inherited from Base
#add_ransacker, #build, build, #embedded?, #initialize, #store_attribute
included
Instance Method Details
#attribute_options ⇒ Object
20
21
22
|
# File 'lib/ar_doc_store/attributes/array.rb', line 20
def attribute_options
{ array: true }
end
|
#attribute_type ⇒ Object
16
17
18
|
# File 'lib/ar_doc_store/attributes/array.rb', line 16
def attribute_type
ActiveModel::Type::Value
end
|
#define_query_method ⇒ Object
4
5
6
7
8
9
10
|
# File 'lib/ar_doc_store/attributes/array.rb', line 4
def define_query_method
model.class_eval <<-CODE, __FILE__, __LINE__ + 1
def #{attribute}?
#{attribute}.present?
end
CODE
end
|
#type ⇒ Object
12
13
14
|
# File 'lib/ar_doc_store/attributes/array.rb', line 12
def type
:array
end
|