Skip to content
This repository has been archived by the owner on Feb 16, 2018. It is now read-only.

Commit

Permalink
Refactor namespace references
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Stuart committed Aug 27, 2012
1 parent cf18908 commit 17b0bfc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions lib/tent-server/api/groups.rb
Expand Up @@ -5,14 +5,14 @@ class Groups

class GetAll < Middleware
def action(env, params, request)
env['response'] = TentServer::Model::Group.all
env['response'] = Model::Group.all
env
end
end

class GetOne < Middleware
def action(env, params, request)
if group = TentServer::Model::Group.get(params[:group_id])
if group = Model::Group.get(params[:group_id])
env['response'] = group
end
env
Expand All @@ -21,7 +21,7 @@ def action(env, params, request)

class Update < Middleware
def action(env, params, request)
if group = TentServer::Model::Group.get(params[:group_id])
if group = Model::Group.get(params[:group_id])
group_attributes = params[:data]
group.update(group_attributes)
env['response'] = group.reload
Expand All @@ -33,7 +33,7 @@ def action(env, params, request)
class Create < Middleware
def action(env, params, request)
group_attributes = params[:data]
env['response'] = TentServer::Model::Group.create!(group_attributes)
env['response'] = Model::Group.create!(group_attributes)
env
end
end
Expand Down
6 changes: 3 additions & 3 deletions lib/tent-server/api/posts.rb
Expand Up @@ -5,7 +5,7 @@ class Posts

class GetOne < Middleware
def action(env, params, request)
if post = ::TentServer::Model::Post.get(params[:post_id])
if post = Model::Post.get(params[:post_id])
env['response'] = post
end
env
Expand All @@ -14,7 +14,7 @@ def action(env, params, request)

class GetFeed < Middleware
def action(env, params, request)
env['response'] = ::TentServer::Model::Post.all(conditions_from_params(params))
env['response'] = Model::Post.all(conditions_from_params(params))
env
end

Expand All @@ -35,7 +35,7 @@ def conditions_from_params(params)
class Create < Middleware
def action(env, params, request)
post_attributes = params[:data]
post = ::TentServer::Model::Post.create!(post_attributes)
post = Model::Post.create!(post_attributes)
env['response'] = post
env
end
Expand Down

0 comments on commit 17b0bfc

Please sign in to comment.