Module: Praxis::Mapper::SequelCompat::ClassMethods
- Defined in:
- lib/praxis-mapper/sequel_compat.rb
Instance Method Summary collapse
- #associations ⇒ Object
- #finalized? ⇒ Boolean
- #identities ⇒ Object
- #repository_name(name = nil) ⇒ Object
Instance Method Details
#associations ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/praxis-mapper/sequel_compat.rb', line 25 def associations orig = self.association_reflections.clone orig.each do |k,v| v[:model] = v.associated_class if v.respond_to?(:primary_key) v[:primary_key] = v.primary_key else # FIXME: figure out exactly what to do here. # not super critical, as we can't track these associations # directly, but it would be nice to traverse these # properly. v[:primary_key] = :unsupported end end orig end |
#finalized? ⇒ Boolean
21 22 23 |
# File 'lib/praxis-mapper/sequel_compat.rb', line 21 def finalized? true end |
#identities ⇒ Object
17 18 19 |
# File 'lib/praxis-mapper/sequel_compat.rb', line 17 def identities [primary_key] end |
#repository_name(name = nil) ⇒ Object
43 44 45 46 47 |
# File 'lib/praxis-mapper/sequel_compat.rb', line 43 def repository_name(name=nil) return @repository_name if name.nil? @repository_name = name end |