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
21
22
23
|
# File 'lib/table_sync/orm_adapter/active_record.rb', line 21
def self.model_naming(object_class)
TableSync::NamingResolver::ActiveRecord.new(table_name: object_class.table_name)
end
|
Instance Method Details
#attributes ⇒ Object
17
18
19
|
# File 'lib/table_sync/orm_adapter/active_record.rb', line 17
def attributes
object.attributes.symbolize_keys
end
|
#find ⇒ Object
5
6
7
8
9
|
# File 'lib/table_sync/orm_adapter/active_record.rb', line 5
def find
@object = object_class.find_by(needle)
super
end
|
#init ⇒ Object
11
12
13
14
15
|
# File 'lib/table_sync/orm_adapter/active_record.rb', line 11
def init
@object = object_class.new(object_data)
super
end
|