Class: TableSync::ORMAdapter::ActiveRecord
- Inherits:
-
Base
- Object
- Base
- TableSync::ORMAdapter::ActiveRecord
show all
- Defined in:
- lib/table_sync/orm_adapter/active_record.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
Instance Method Details
#attributes ⇒ Object
21
22
23
|
# File 'lib/table_sync/orm_adapter/active_record.rb', line 21
def attributes
object.attributes.symbolize_keys
end
|
#find ⇒ Object
9
10
11
12
13
|
# File 'lib/table_sync/orm_adapter/active_record.rb', line 9
def find
@object = object_class.find_by(needle)
super
end
|
#init ⇒ Object
15
16
17
18
19
|
# File 'lib/table_sync/orm_adapter/active_record.rb', line 15
def init
@object = object_class.new(object_data)
super
end
|