File tree Expand file tree Collapse file tree
lib/active_record/connection_adapters
spec/active_record/connection_adapters/oracle_enhanced Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ def auto_incremented_by_db?
3232 @identity
3333 end
3434
35- def auto_populated ?
35+ def auto_populated_on_insert ?
3636 super || @trigger_assigned
3737 end
3838
Original file line number Diff line number Diff line change @@ -1304,7 +1304,7 @@ def prefetch_primary_key_from_schema_cache(table_name)
13041304 pk_col = primary_key_column_from_schema_cache ( table_name )
13051305 # Propagate false (cache says no-prefetch) and nil (caller must fall back) as-is.
13061306 return pk_col unless pk_col . is_a? ( OracleEnhanced ::Column )
1307- !( pk_col . auto_incremented_by_db? || pk_col . auto_populated ?)
1307+ !( pk_col . auto_incremented_by_db? || pk_col . auto_populated_on_insert ?)
13081308 end
13091309
13101310 def primary_key_column_from_schema_cache ( table_name )
Original file line number Diff line number Diff line change @@ -453,7 +453,7 @@ def trigger_exists?(name)
453453 end
454454 end
455455
456- describe "auto_populated ? on the primary key column" do
456+ describe "auto_populated_on_insert ? on the primary key column" do
457457 it "reports true for a trigger-backed primary key" do
458458 schema_define do
459459 create_table :test_pk_triggers , primary_key_trigger : true do |t |
@@ -462,7 +462,7 @@ def trigger_exists?(name)
462462 end
463463
464464 pk_column = @conn . columns ( :test_pk_triggers ) . find { |c | c . name == "id" }
465- expect ( pk_column . auto_populated ?) . to be true
465+ expect ( pk_column . auto_populated_on_insert ?) . to be true
466466 end
467467
468468 it "reports false for a plain sequence-backed primary key" do
@@ -473,7 +473,7 @@ def trigger_exists?(name)
473473 end
474474
475475 pk_column = @conn . columns ( :test_pk_triggers ) . find { |c | c . name == "id" }
476- expect ( pk_column . auto_populated ?) . to be false
476+ expect ( pk_column . auto_populated_on_insert ?) . to be false
477477 end
478478
479479 it "reports false when only an unrelated BEFORE INSERT trigger exists" do
@@ -493,7 +493,7 @@ def trigger_exists?(name)
493493 SQL
494494
495495 pk_column = @conn . columns ( :test_pk_triggers ) . find { |c | c . name == "id" }
496- expect ( pk_column . auto_populated ?) . to be false
496+ expect ( pk_column . auto_populated_on_insert ?) . to be false
497497 end
498498
499499 it "drives _returning_columns_for_insert for trigger-backed tables" do
Original file line number Diff line number Diff line change 163163 expect ( restored . instance_variable_get ( :@identity ) ) . to eq ( original . instance_variable_get ( :@identity ) )
164164 expect ( restored . instance_variable_get ( :@trigger_assigned ) ) . to eq ( original . instance_variable_get ( :@trigger_assigned ) )
165165 expect ( restored . auto_incremented_by_db? ) . to eq ( original . auto_incremented_by_db? )
166- expect ( restored . auto_populated ?) . to eq ( original . auto_populated ?)
166+ expect ( restored . auto_populated_on_insert ?) . to eq ( original . auto_populated_on_insert ?)
167167 end
168168
169169 it "leaves @identity and @trigger_assigned undefined when YAML predates these keys" do
213213
214214 it "carries trigger_assigned = true through the YAML round trip" do
215215 original = schema_cache . columns ( "test_schema_cache_legacy_posts" ) . find { |c | c . name == "id" }
216- expect ( original . auto_populated ?) . to be true
216+ expect ( original . auto_populated_on_insert ?) . to be true
217217
218218 restored = YAML . safe_load ( YAML . dump ( original ) , permitted_classes : PERMITTED_YAML_CLASSES , aliases : true )
219- expect ( restored . auto_populated ?) . to be true
219+ expect ( restored . auto_populated_on_insert ?) . to be true
220220 expect ( restored . instance_variable_get ( :@trigger_assigned ) ) . to be true
221221 end
222222 end
You can’t perform that action at this time.
0 commit comments