class Miniblog::Admin::TransitionsController
Public Instance Methods
create()
click to toggle source
# File app/controllers/miniblog/admin/transitions_controller.rb, line 6 def create namespace = '_as_publisher' if current_user.is_publisher? @post.send "#{params[:transition]}#{namespace}" status = @post.status_change_records.build(user: current_user, state: params[:transition]) status.save redirect_to admin_posts_path end
Private Instance Methods
load_post()
click to toggle source
# File app/controllers/miniblog/admin/transitions_controller.rb, line 16 def load_post post = Post.scoped_for(current_user).find(params[:id]) @post = PostPresenter.new(post, current_user) end