Class: Dock::Cequel
- Inherits:
-
Base
show all
- Defined in:
- lib/dock/adapters/cequel.rb
Instance Attribute Summary
Attributes inherited from Base
#model
Instance Method Summary
collapse
Methods inherited from Base
#embedded, inherited, #initialize, #scoped
Constructor Details
This class inherits a constructor from Dock::Base
Instance Method Details
#all(options = {}) ⇒ Object
16
17
18
|
# File 'lib/dock/adapters/cequel.rb', line 16
def all(options = {})
construct_scope(options).to_a
end
|
#associations ⇒ Object
32
33
34
|
# File 'lib/dock/adapters/cequel.rb', line 32
def associations()
end
|
#belongs_to ⇒ Object
48
49
50
|
# File 'lib/dock/adapters/cequel.rb', line 48
def belongs_to()
end
|
#column_names ⇒ Object
38
39
40
|
# File 'lib/dock/adapters/cequel.rb', line 38
def column_names
model.columns.map { |column| column.name }
end
|
#count(options = {}) ⇒ Object
42
43
44
|
# File 'lib/dock/adapters/cequel.rb', line 42
def count(options = {})
all(options).count
end
|
#create(attributes = {}) ⇒ Object
5
6
7
|
# File 'lib/dock/adapters/cequel.rb', line 5
def create(attributes = {})
model.create(attributes)
end
|
#cyclic? ⇒ Boolean
60
61
62
|
# File 'lib/dock/adapters/cequel.rb', line 60
def cyclic?
false
end
|
#destroy(record) ⇒ Object
29
30
31
|
# File 'lib/dock/adapters/cequel.rb', line 29
def destroy(record)
record.destroy
end
|
#embedded? ⇒ Boolean
57
58
59
|
# File 'lib/dock/adapters/cequel.rb', line 57
def embedded?
false
end
|
#encoding ⇒ Object
45
46
47
|
# File 'lib/dock/adapters/cequel.rb', line 45
def encoding
'UTF-8'
end
|
#find(key_values) ⇒ Object
8
9
10
11
12
|
# File 'lib/dock/adapters/cequel.rb', line 8
def find(key_values)
find!(key_values)
rescue Cequel::Record::RecordNotFound
nil
end
|
#find!(key_values) ⇒ Object
13
14
15
|
# File 'lib/dock/adapters/cequel.rb', line 13
def find!(key_values)
model.find(*key_values)
end
|
#first(options = {}) ⇒ Object
19
20
21
|
# File 'lib/dock/adapters/cequel.rb', line 19
def first(options = {})
construct_scope(options).first
end
|
#has_many ⇒ Object
51
52
53
|
# File 'lib/dock/adapters/cequel.rb', line 51
def has_many()
end
|
#id ⇒ Object
22
23
24
|
# File 'lib/dock/adapters/cequel.rb', line 22
def id
'id'
end
|
#model_name ⇒ Object
35
36
37
|
# File 'lib/dock/adapters/cequel.rb', line 35
def model_name
model.class.name
end
|
#properties ⇒ Object
66
67
68
|
# File 'lib/dock/adapters/cequel.rb', line 66
def properties()
end
|
#scoped? ⇒ Boolean
54
55
56
|
# File 'lib/dock/adapters/cequel.rb', line 54
def scoped?
false
end
|
#supports_joins? ⇒ Boolean
63
64
65
|
# File 'lib/dock/adapters/cequel.rb', line 63
def supports_joins?
false
end
|
#update(search_key, find_by, update_key, by_value) ⇒ Object
25
26
27
28
|
# File 'lib/dock/adapters/cequel.rb', line 25
def update(search_key, find_by, update_key, by_value)
entry = model.find(update_key).posts.find(find_by)
entry.update_attributes!(update_key by_value)
end
|