1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

12 commits

Author SHA1 Message Date
Akira Matsuda
c2bfe6cbc8 Privatize config_accessor as with attr_accessor 2015-02-06 01:12:07 +09:00
Rafael Mendonça França
04ad814bb9 Make sure multiline string is not accepted by the regexp 2013-12-19 17:28:19 -02:00
Hincu Petru
4cb30d9f8b Fixed configurable.rb regular expression name check 2013-12-19 17:30:01 +00:00
Zoltan Kiss
c651cc9d50 minor grammar fix 2012-12-24 15:20:05 -06:00
Larry Lv
1efe30ebce set up config_accessor with a default value by block
* ActiveSupport::Configurable should allow config_accessor to take
  default value by block, just like cattr_accessor.

    class User
      include ActiveSupport::Configurable
      config_accessor :hair_colors do
        [:brown, :black, :blonde, :red]
      end
    end

    User.hair_colors # => [:brown, :black, :blonde, :red]

* remove trailing whitespaces in configurable.rb and its test file.

* Update ActiveSupport CHANGELOG.
2012-09-17 09:14:21 +08:00
Francesco Rodriguez
5e1d40f773 add instance_accessor option to ActiveSupport::Configurable#config_accessor
Changes:

* Add `instance_accessor` option to opt out of the instance writer and
  instance reader methods.
* Raises a NameError if the name of the attribute is not valid.
* Update documentation and tests.
* Add CHANGELOG entry in activesupport.
2012-06-05 10:50:48 -05:00
José Valim
d677097eb6 Fix configurable cristalization and tests. 2011-06-29 13:57:59 -03:00
José Valim
894bdbd53d Move variables to underscore format, update protected instance variables list. 2011-05-06 14:57:25 +02:00
Oriol Gual and Josep M. Bach
f42562f97b Make ActiveSupport::Configurable work with modules
[#6486 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-28 13:30:32 -02:00
José Valim
6067d16200 Call it compile_methods! and do the same on AM. 2010-09-27 20:43:56 +02:00
thedarkone
918dc27345 Compile ActionController::Base.config's methods to avoid method_missing overhead. 2010-09-27 17:45:58 +02:00
José Valim
4163ccec23 Clean up the config object in ActionPack. Create config_accessor which just delegates to the config object, reducing the number of deprecations and add specific tests. 2010-04-22 12:00:13 +02:00