aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/class/attribute_accessors.rb
Commit message (Collapse)AuthorAgeFilesLines
* [Active Support] require_relative => requireAkira Matsuda2017-10-211-1/+1
| | | | This basically reverts 8da30ad6be34339124ba4cb4e36aea260dda12bc
* [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-091-0/+1
|
* [Active Support] require => require_relativeAkira Matsuda2017-07-011-1/+1
|
* applies new string literal convention in activesupport/libXavier Noria2016-08-061-1/+1
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Remove deprecation on active_support/core_ext/class/attribute_accessors ↵Jeremy Kemper2014-03-151-5/+3
| | | | requires. Appropriate to keep this, users don't care that the implementation got unified.
* Unify cattr and mattr accessors declarationsGenadi Samokovarov2013-12-021-180/+5
|
* Merge remote-tracking branch 'docrails/master'Xavier Noria2013-11-241-1/+1
|\ | | | | | | | | | | Conflicts: activesupport/lib/active_support/core_ext/hash/deep_merge.rb activesupport/lib/active_support/core_ext/hash/keys.rb
| * Change syntax format for example returned valuesPrem Sichanugrist2013-11-111-1/+1
| | | | | | | | | | | | | | | | | | According to our guideline, we leave 1 space between `#` and `=>`, so we want `# =>` instead of `#=>`. Thanks to @fxn for the suggestion. [ci skip]
* | Unify `cattr_*` interface: allow to pass a block to `cattr_reader`.Alexey Chernenkov2013-11-151-0/+11
|/ | | | | | | | | Example: class A cattr_reader(:defr) { 'default_reader_value' } end A.defr # => 'default_reader_value'
* more descriptive NameError's messages for class attributesHrvoje Šimić2013-04-171-2/+2
|
* cut some duplication and minor edits [ci skip]Vijay Dev2012-05-081-37/+4
|
* added docs to cattr_readerFrancesco Rodriguez2012-05-071-0/+27
|
* better docs for cattr_accessor and cattr_writerFrancesco Rodriguez2012-05-071-2/+14
|
* added docs and examples to cattr_writer methodFrancesco Rodriguez2012-05-071-5/+41
|
* added docs to cattr_accessor methodFrancesco Rodriguez2012-05-071-12/+50
|
* adding example about using cattr_accessor with subclassesFrancesco Rodriguez2012-05-071-0/+8
|
* String quotes and trailing spacesAlexey Gaziev2012-04-291-2/+2
|
* AS core_ext refactoringAlexey Gaziev2012-04-291-1/+1
|
* validate attribute names in class and module attribute accessorsDmitry Plashchynski2012-03-301-0/+2
|
* Added instance_accessor: false as an option to Class#cattr_accessor and ↵David Heinemeier Hansson2011-06-131-2/+3
| | | | friends [DHH]
* applied guidelines to "# =>"Paco Guzman2010-08-121-2/+2
|
* adding comment specifying that cattr_accessor also supports instance_write ↵Neeraj Singh2010-07-281-0/+10
| | | | and instance_rader option
* adding some comments to cattr_accessor methodNeeraj Singh2010-07-281-0/+6
|
* LINE on class_eval need + 1, also removed comments [#4281 state:committed]Santiago Pastorino2010-03-271-24/+27
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* flatten not needed hereSantiago Pastorino2010-03-271-2/+2
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* fixing inconsistency with cattr_reader and matter_reader [#4172 state:resolved]Kabari Hendrick2010-03-271-5/+8
| | | Signed-off-by: wycats <wycats@gmail.com>
* Got overhead down from 127 to 85. All tests pass:Yehuda Katz2009-08-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | * Tentatively replaced HeaderHash with SimpleHeaderHash, which does not preserve case but does handle converting Arrays to Strings in to_hash. This requires further discussion. * Moved default_charset to ActionDispatch::Response to avoid having to hop over to ActionController. Ideally, this would be a constant on AD::Response, but some tests expect to be able to change it dynamically and I didn't want to change them yet. * Completely override #initialize from Rack::Response. Previously, it was creating a HeaderHash, and then we were creating an entirely new one. There is no way to call super without incurring the overhead of creating a HeaderHash. * Override #write from Rack::Response. Its implementation tracks Content-Length, and doing so adds additional overhead that could be mooted if other middleware changes the body. It is more efficiently done at the top-level server. * Change sending_file to an instance_variable instead of header inspection. In general, if a state is important, it should be set as a property of the response not reconstructed later. * Set the Etag to @body instead of .body. AS::Cache.expand_cache_key handles Arrays fine, and it's more efficient to let it handle the body parts, since it is not forced to create a joined String. * If we detect the default cache control case, just set it, rather than setting the constituent parts and then running the normal (expensive) code to generate the string.
* Fix tests on 1.9Jeremy Kemper2009-04-221-0/+2
|
* Sync with rails/rails/master, merge two metaprogramming annotation effortsMichael S. Klishin2008-12-281-24/+24
|\
| * Inline code comments for class_eval/module_eval [#1657 state:resolved]Xavier Noria2008-12-281-24/+24
| | | | | | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* | Annotated metaprogramming code across ActiveSupportMichael S. Klishin2008-12-281-23/+23
|/
* Improve documentation coverage and markupXavier Noria2008-05-021-1/+7
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Refactored in use of extract_options! (closes #9079) [josh]David Heinemeier Hansson2007-07-241-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7220 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added :instance_writer option to #mattr_writer/accessor, ↵Rick Olson2007-01-281-0/+4
| | | | | | #cattr_writer/accessor, and #class_inheritable_writer to skip the creation of the instance writer. [Rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6050 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added reusable reloading support through the inclusion of the Relodable ↵David Heinemeier Hansson2006-01-291-0/+44
module that all subclasses of ActiveRecord::Base, ActiveRecord::Observer, ActiveController::Base, and ActionMailer::Base automatically gets [DHH]. Added auto-loading support for classes in modules, so Conductor::Migration will look for conductor/migration.rb and Conductor::Database::Settings will look for conductor/database/settings.rb [Nicholas Seckar]. Refactored extensions to module, class, and object in active support [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3493 5ecf4fe2-1ee6-0310-87b1-e25e094e27de