app/models/concerns/shared/identifiers.rb
# Exact match on identifier + namespace, return an Array, not Arel
# @param [String, String] namespace_name is either the long or short namespace name.
# @return [Scope]
Exact match on identifier + namespace, return an Array, not Arel
Exact match on identifier + namespace return an Array not Arel
def with_namespaced_identifier(namespace_name, identifier)
      i = Identifier.arel_table
      n = Namespace.arel_table
      s = self.arel_table
      c1 = n[:name].eq(namespace_name).or(n[:short_name].eq(namespace_name))
      c2 = i[:identifier].eq(identifier)
      j = i.join(n).on(i[:namespace_id].eq(n[:id]))
      l = s.join(i).on(s[:id].eq(i[:identifier_object_id]).and(i[:identifier_object_type].eq(self.base_class.name)))
      self.joins(l.join_sources, j.join_sources).where(c1.and(c2).to_sql)
    end
def with_namespaced_identifier ( namespace_name , identifier ) i = Identifier . arel_table n = Namespace . arel_table s = self . arel_table c1 = n [ :name ] . eq ( namespace_name ) . or ( n [ :short_name ] . eq ( namespace_name ) ) c2 = i [ :identifier ] . eq ( identifier ) j = i . join ( n ) . on ( i [ :namespace_id ] . eq ( n [ :id ] ) ) l = s . join ( i ) . on ( s [ :id ] . eq ( i [ :identifier_object_id ] ) . and ( i [ :identifier_object_type ] . eq ( self . base_class . name ) ) ) self . joins ( l . join_sources , j . join_sources ) . where ( c1 . and ( c2 ) . to_sql ) end
Exact match on identifier + namespace, return an Array, not Arel
Exact match on identifier + namespace return an Array not Arel
# conditions # join identifiers to namespaces # join self to identifiers
None
Scope
namespace_name
<not_specific>
identifier
<not_specific>
<not_specific>
namespace_name is either the long or short namespace name.
namespace_name is either the long or short namespace name .