File tree Expand file tree Collapse file tree 3 files changed +4
-29
lines changed
lib/active_record/connection_adapters/abstract Expand file tree Collapse file tree 3 files changed +4
-29
lines changed Original file line number Diff line number Diff line change 1+ * Remove deprecated ` #set_state ` from the transaction object.
2+
3+ * Rafael Mendonça França*
4+
15* Remove deprecated ` #supports_statement_cache? ` from the database adapters.
26
37 * Rafael Mendonça França*
Original file line number Diff line number Diff line change @@ -40,24 +40,6 @@ def completed?
4040 committed? || rolledback?
4141 end
4242
43- def set_state ( state )
44- ActiveSupport ::Deprecation . warn ( <<-MSG . squish )
45- The set_state method is deprecated and will be removed in
46- Rails 6.0. Please use rollback! or commit! to set transaction
47- state directly.
48- MSG
49- case state
50- when :rolledback
51- rollback!
52- when :committed
53- commit!
54- when nil
55- nullify!
56- else
57- raise ArgumentError , "Invalid transaction state: #{ state } "
58- end
59- end
60-
6143 def rollback!
6244 @children . each { |c | c . rollback! }
6345 @state = :rolledback
Original file line number Diff line number Diff line change @@ -884,17 +884,6 @@ def test_transactions_state_from_commit
884884 assert_predicate transaction . state , :committed?
885885 end
886886
887- def test_set_state_method_is_deprecated
888- connection = Topic . connection
889- transaction = ActiveRecord ::ConnectionAdapters ::TransactionManager . new ( connection ) . begin_transaction
890-
891- transaction . commit
892-
893- assert_deprecated do
894- transaction . state . set_state ( :rolledback )
895- end
896- end
897-
898887 def test_mark_transaction_state_as_committed
899888 connection = Topic . connection
900889 transaction = ActiveRecord ::ConnectionAdapters ::TransactionManager . new ( connection ) . begin_transaction
You can’t perform that action at this time.
0 commit comments