diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2010-11-30 09:44:12 -0500 |
---|---|---|
committer | Neeraj Singh <neerajdotname@gmail.com> | 2010-11-30 09:44:12 -0500 |
commit | aa1ac1ca8cf9557dae72604a48de1f0e58515b40 (patch) | |
tree | 871e0e8ef4b6913beb73dec3d9355336e54a5053 /activesupport | |
parent | aa9a3227a0151af87e1eb5a6c4b7b0b095fc33c9 (diff) | |
download | rails-aa1ac1ca8cf9557dae72604a48de1f0e58515b40.tar.gz rails-aa1ac1ca8cf9557dae72604a48de1f0e58515b40.tar.bz2 rails-aa1ac1ca8cf9557dae72604a48de1f0e58515b40.zip |
Add comment for config_accessor method
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/configurable.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/configurable.rb b/activesupport/lib/active_support/configurable.rb index 58ed37b018..644db0b205 100644 --- a/activesupport/lib/active_support/configurable.rb +++ b/activesupport/lib/active_support/configurable.rb @@ -38,6 +38,18 @@ module ActiveSupport yield config end + # Allows you to add shortcut so that you don't have to refer to attribute through config. + # Also look at the example for config to contrast. + # + # class User + # include ActiveSupport::Configurable + # config_accessor :allowed_access + # end + # + # user = User.new + # user.allowed_access = true + # user.allowed_access # => true + # def config_accessor(*names) names.each do |name| code, line = <<-RUBY, __LINE__ + 1 |