Methods
Attributes
| [RW] | store |
Public Instance methods
[ show source ]
# File lib/og/store/sql.rb, line 23
23: def og_allocate(res, row = 0)
24: if schema_inheritance?
25: begin
26: Object.constant(res['ogtype']).allocate
27: rescue TypeError => e
28: # FIXME: use res['ogtype'] here, this is slow!
29: # But res['ogtype'] isn't implemented in -pr and some mysql exts,
30: # create compat layer
31: col = nil
32: ogmanager.with_store do |s|
33: col = s.create_field_map(self)[:ogtype]
34: end
35: Object.constant(res[col]).allocate
36: ensure
37: res.close if res.respond_to?(:close)
38: end
39: else
40: self.allocate
41: end
42: end
[ show source ]
# File lib/og/store/sql.rb, line 12
12: def set_table(table_name)
13: meta = (class << self; self; end)
14: meta.send(:define_method, :table) do
15: return table_name
16: end
17: meta.send(:alias_method, :schema, :table)
18: end