Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10648 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

[PATCH] (compat 1.9) make Module#local_constants exact

Reported by: fxn Assigned to: bitsweat
Priority: normal Milestone: 2.1
Component: ActiveSupport Version: edge
Severity: minor Keywords:
Cc:

Description

Module#local_constants computes local constants by hand and there is a documented little risk doing so. In Ruby 1.9 it is equivalent to Module#constants(false) and thus we can avoid the risk altogether.

Attachments

make_module_local_constants_exact_in_1_9.diff (0.9 kB) - added by fxn on 12/30/07 01:34:12.
make_module_local_constants_exact_in_1_9_at_definition_time.diff (1.5 kB) - added by fxn on 01/04/08 02:17:49.

Change History

12/30/07 01:34:12 changed by fxn

  • attachment make_module_local_constants_exact_in_1_9.diff added.

12/30/07 01:35:26 changed by fxn

  • owner changed from core to bitsweat.

12/30/07 05:27:40 changed by chuyeow

+1

Existing test for local_constants pass in 1.8.6 and 1.9 for me.

12/30/07 07:58:20 changed by fcheung

+1 Looks good to me.

01/02/08 08:21:54 changed by bitsweat

  • milestone changed from 2.x to 2.1.

Can do the conditional on the method definition itself, rather than at runtime.

01/04/08 02:17:49 changed by fxn

  • attachment make_module_local_constants_exact_in_1_9_at_definition_time.diff added.

01/04/08 02:18:46 changed by fxn

Sure, another patch was attached.

01/04/08 03:25:24 changed by bitsweat

  • status changed from new to closed.
  • resolution set to fixed.

(In [8555]) Ruby 1.9: Module#local_constants can now just use constants(false). Closes #10648 [Xavier Noria]