Skip to content

Commit

Permalink
pull conditional up into high level action description.
Browse files Browse the repository at this point in the history
  • Loading branch information
botandrose-machine committed Sep 26, 2015
1 parent 97e7e07 commit b31a88e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/controllers/calagator/venues_controller.rb
Expand Up @@ -110,7 +110,7 @@ def create

class CreateOrUpdate < SimpleDelegator
def call
block_spammers or save
block_spammers or (save and render_success) or render_failure
end

private
Expand All @@ -122,8 +122,7 @@ def block_spammers
end

def save
venue.attributes = params.permit![:venue].to_h
venue.save ? render_success : render_failure
venue.update_attributes params.permit![:venue].to_h
end

def render_success
Expand Down

0 comments on commit b31a88e

Please sign in to comment.