Skip to content
Snippets Groups Projects
Commit 1cedfafd authored by Mauricio Giacomini Girardello's avatar Mauricio Giacomini Girardello
Browse files

improvement some repository calls

parent 5b213d99
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,7 @@ class Management::UsersController < ManagementController
@user = User.new(user_params)
respond_to do |format|
if @user.save
if user_repository.save @user
format.html { redirect_to management_user_path(@user), notice: "User created!" }
format.json { render :show, status: :created, location: @user }
else
......
......@@ -2,6 +2,14 @@
# This carousel repository delegates all behavior to ActiveRecord
class ActiveRecord::CarouselRepository
def save(carousel)
carousel.save
end
def save!(carousel)
carousel.save!
end
def method_missing(method_name, *arguments, &block)
Carousel.send(method_name, *arguments, &block)
end
......
......@@ -30,6 +30,10 @@ module RepositoriesProxy
application_repository.for(:mainPage)
end
def user_repository
application_repository.for(:user)
end
private
def application_repository
......
......@@ -24,6 +24,14 @@ class UserRepositoryProxy
orientdb_user_repository.destroy_graph_node user
end
def save(user)
user.save
end
def save!(user)
user.save!
end
def method_missing(method_name, *arguments, &block)
User.send(method_name, *arguments, &block)
end
......
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