Skip to content

Commit 4493a42

Browse files
authored
Merge pull request #92 from remofritzsche/master
Do not use 'return false' in AR callbacks for compatibility with Rails 5
2 parents 01440b7 + 0c0a04f commit 4493a42

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/active_record/session_store/session.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,21 @@ def loaded?
8080

8181
private
8282
def serialize_data!
83-
return false unless loaded?
83+
unless loaded?
84+
return false if Rails::VERSION::MAJOR < 5
85+
throw :abort
86+
end
8487
write_attribute(@@data_column_name, self.class.serialize(data))
8588
end
8689

8790
# Ensures that the data about to be stored in the database is not
8891
# larger than the data storage column. Raises
8992
# ActionController::SessionOverflowError.
9093
def raise_on_session_data_overflow!
91-
return false unless loaded?
94+
unless loaded?
95+
return false if Rails::VERSION::MAJOR < 5
96+
throw :abort
97+
end
9298
limit = self.class.data_column_size_limit
9399
if limit and read_attribute(@@data_column_name).size > limit
94100
raise ActionController::SessionOverflowError

0 commit comments

Comments
 (0)