class Arpa::Repositories::Profiles::Finder

Public Instance Methods

all() click to toggle source
# File lib/arpa/repositories/profiles/finder.rb, line 12
def all
  repository_class.all.collect do |record|
    mapper_instance.map_to_entity(record)
  end
end
all_by_entity(entity_id, entity_class) click to toggle source
# File lib/arpa/repositories/profiles/finder.rb, line 18
def all_by_entity(entity_id, entity_class)
  repository_class
    .where("( (entity_id is null AND entity_class is null) OR (entity_id = '#{entity_id}' AND entity_class = '#{entity_class}') )")
    .collect do |record|
    mapper_instance.map_to_entity(record)
  end
end
find(id) click to toggle source
# File lib/arpa/repositories/profiles/finder.rb, line 7
def find(id)
  record = repository_class.find(id)
  mapper_instance.map_to_entity(record)
end
mapper_instance() click to toggle source
# File lib/arpa/repositories/profiles/finder.rb, line 26
def mapper_instance
  Arpa::DataMappers::ProfileMapper.instance
end
repository_class() click to toggle source
# File lib/arpa/repositories/profiles/finder.rb, line 30
def repository_class
  RepositoryProfile
end