Skip to content

Commit

Permalink
inline #verify_locked_status to increase locality.
Browse files Browse the repository at this point in the history
  • Loading branch information
botandrose-machine committed Sep 24, 2015
1 parent 87e2182 commit f5b82bc
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions app/models/calagator/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Event < ActiveRecord::Base
:allow_blank => true,
:allow_nil => true

before_destroy :verify_lock_status
before_destroy { !locked } # prevent locked events from being destroyed

# Duplicates
include DuplicateChecking
Expand Down Expand Up @@ -170,12 +170,6 @@ def duration
return 0 unless end_time && start_time
(end_time - start_time)
end

private

def verify_lock_status
return !locked
end
end

end

0 comments on commit f5b82bc

Please sign in to comment.