Skip to content

Commit

Permalink
remove || raise and get closer to master
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Dec 17, 2019
1 parent 2b205ed commit 1c7e3b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions lib/rack/session/abstract/id.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,8 @@ def initialize(store, req)
end

def id
if @loaded or instance_variable_defined?(:@id)
else
@id = @store.send(:extract_session_id, @req)
end
@id || raise
return @id if @loaded or instance_variable_defined?(:@id)
@id = @store.send(:extract_session_id, @req)
end

def options
Expand Down Expand Up @@ -122,7 +119,7 @@ def clear

def destroy
clear
@id = @store.send(:delete_session, @req, id, options) || raise
@id = @store.send(:delete_session, @req, id, options)
end

def to_hash
Expand Down
2 changes: 1 addition & 1 deletion lib/rack/session/cookie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def initialize(app, options={})
def find_session(req, sid)
data = unpacked_cookie_data(req)
data = persistent_session_id!(data)
[data["session_id"] || raise, data]
[data["session_id"], data]
end

def extract_session_id(request)
Expand Down

0 comments on commit 1c7e3b2

Please sign in to comment.