Skip to content
Snippets Groups Projects
Commit dc03c9c8 authored by Matheus Agio Nerone's avatar Matheus Agio Nerone
Browse files

remove mainpage repository

parent 0d02a4c4
No related branches found
No related tags found
No related merge requests found
module OrientDb
class MainPageRepository < Base
def all
connection.query "SELECT FROM MainPage"
end
def find(id)
connection.query "SELECT FROM MainPage where @rid = '#{id}'"
end
def insert_data (name,url)
connection.command "INSERT INTO MainPage (name,URL) VALUES ('#{name}','#{url}')"
end
def destroy_data(id)
return @connection.command "DELETE VERTEX MainPage where @rid = '#{id}'"
rescue
return nil
end
def update(id,operation,atributte,new)
puts "update #{id} #{operation} #{atributte} = #{new}"
connection.command "update #{id} #{operation} #{atributte} = #{new}"
end
private
def odb_class
"MainPage"
end
end
end
......@@ -30,10 +30,6 @@ module RepositoriesProxy
application_repository.for(:carousel)
end
def main_page_repository
application_repository.for(:mainPage)
end
def user_repository
application_repository.for(:user)
end
......
......@@ -20,7 +20,6 @@ end
# initialize repositories
Repository::Environments.create :development do |repository|
repository.register :learning_object, OrientDb::LearningObjectRepository.new(OrientDb::Client.instance)
repository.register :mainPage, OrientDb::MainPageRepository.new(OrientDb::Client.instance)
repository.register :user, UserRepositoryProxy.new(OrientDb::UserRepository.new(OrientDb::Client.instance))
repository.register :subject, OrientDb::SubjectRepository.new(OrientDb::Client.instance)
repository.register :institution, OrientDb::InstitutionRepository.new(OrientDb::Client.instance)
......@@ -34,7 +33,6 @@ end
Repository::Environments.create :test do |repository|
repository.register :learning_object, OrientDb::LearningObjectRepository.new(OrientDb::Client.instance)
repository.register :mainPage, OrientDb::MainPageRepository.new(OrientDb::Client.instance)
repository.register :user, UserRepositoryProxy.new(OrientDb::UserRepository.new(OrientDb::Client.instance))
repository.register :subject, OrientDb::SubjectRepository.new(OrientDb::Client.instance)
repository.register :institution, OrientDb::InstitutionRepository.new(OrientDb::Client.instance)
......@@ -48,7 +46,6 @@ end
Repository::Environments.create :production do |repository|
repository.register :learning_object, OrientDb::LearningObjectRepository.new(OrientDb::Client.instance)
repository.register :mainPage, OrientDb::MainPageRepository.new(OrientDb::Client.instance)
repository.register :user, UserRepositoryProxy.new(OrientDb::UserRepository.new(OrientDb::Client.instance))
repository.register :subject, OrientDb::SubjectRepository.new(OrientDb::Client.instance)
repository.register :institution, OrientDb::InstitutionRepository.new(OrientDb::Client.instance)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment