Class: TableSync::ORMAdapter::Sequel
- Inherits:
-
Base
- Object
- Base
- TableSync::ORMAdapter::Sequel
show all
- Defined in:
- lib/table_sync/orm_adapter/sequel.rb
Instance Attribute Summary
Attributes inherited from Base
#object, #object_class, #object_data
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#attributes_for_destroy, #attributes_for_headers, #attributes_for_routing_key, #attributes_for_update, #empty?, #initialize, #needle, #primary_key_columns, #validate!
Class Method Details
.model_naming(object_class) ⇒ Object
5
6
7
8
9
|
# File 'lib/table_sync/orm_adapter/sequel.rb', line 5
def self.model_naming(object_class)
TableSync::NamingResolver::Sequel.new(
table_name: object_class.table_name, db: object_class.db,
)
end
|
Instance Method Details
#attributes ⇒ Object
11
12
13
|
# File 'lib/table_sync/orm_adapter/sequel.rb', line 11
def attributes
object.values
end
|
#find ⇒ Object
23
24
25
26
27
|
# File 'lib/table_sync/orm_adapter/sequel.rb', line 23
def find
@object = object_class.find(needle)
super
end
|
#init ⇒ Object
15
16
17
18
19
20
21
|
# File 'lib/table_sync/orm_adapter/sequel.rb', line 15
def init
@object = object_class.new(object_data.except(*primary_key_columns))
@object.set_fields(needle, needle.keys)
super
end
|