Method: HODB#rightModel
- Defined in:
- lib/hdb/hodb.rb
#rightModel ⇒ Object
a_table <–> manyToMany <–> b_table To access to b_table from a_table -> a_table.a_table_b_table_join.rightModel Moreover on right model is unsense call the create function
296 297 298 299 300 301 302 303 304 305 306 307 |
# File 'lib/hdb/hodb.rb', line 296 def rightModel rightModelName = @tmp[:rightModelName] return @tableCursor[rightModelName] if @tableCursor[rightModelName] ids = @table.column(@tmp[:referenceFieldName]) where = "id IN (#{ids.join(',')})" odb = self.newHODB(rightModelName, type: 'rightTable').findBy(where) if (@type == 'manyToMany') @visited.addIfNotPresent(odb) return @tableCursor[rightModelName] = odb end |