aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/serialization.rb
Commit message (Collapse)AuthorAgeFilesLines
* Use `try` only when we're unsure if the receiver would respond_to the methodAkira Matsuda2019-08-011-1/+1
|
* Use frozen-string-literal in ActiveRecordKir Shatrov2017-07-191-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Allow ActiveRecord::Base.as_json to accept a frozen HashIsaac Betesh2017-02-081-1/+1
|
* applies new doc guidelines to Active Record.Yves Senn2015-10-141-1/+1
| | | | | | | | | | | | | | | | | | | The focus of this change is to make the API more accessible. References to method and classes should be linked to make it easy to navigate around. This patch makes exzessiv use of `rdoc-ref:` to provide more readable docs. This makes it possible to document `ActiveRecord::Base#save` even though the method is within a separate module `ActiveRecord::Persistence`. The goal here is to bring the API closer to the actual code that you would write. This commit only deals with Active Record. The other gems will be updated accordingly but in different commits. The pass through Active Record is not completely finished yet. A follow up commit will change the spots I haven't yet had the time to update. /cc @fxn
* Remove XML Serialization from core.Zachary Scott2015-08-071-2/+0
| | | | | | | This includes the following classes: - ActiveModel::Serializers::Xml - ActiveRecord::Serialization::XmlSerializer
* Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-291-1/+1
|
* `ActiveRecord::Base.include_root_in_json` is `false` by default.Yves Senn2013-03-041-1/+1
| | | | | | | | | | | | Closes #9459. The PR #6597 unified the configuration for `include_root_in_json` in AM and AR to `false`. Later on with the refactoring commit: e030f26 the value in AR was set to `true` but I think this was not on purpose. With this commit both AM and AR will have the same configuration for `include_root_in_json`, which is `false`.
* include_root_in_json allows inheritance.kennyj2012-10-311-1/+0
|
* Remove ActiveRecord::ModelJon Leighton2012-10-261-9/+2
| | | | | | | | | | In the end I think the pain of implementing this seamlessly was not worth the gain provided. The intention was that it would allow plain ruby objects that might not live in your main application to be subclassed and have persistence mixed in. But I've decided that the benefit of doing that is not worth the amount of complexity that the implementation introduced.
* Revert "Get rid of the ActiveRecord::Model::DeprecationProxy thing."Jeremy Kemper2012-10-201-1/+1
| | | | This reverts commit 83846838252397b3781eed165ca301e05db39293.
* Get rid of the ActiveRecord::Model::DeprecationProxy thing.Jon Leighton2012-10-191-1/+1
| | | | | | | | | | | | | | | | | I think it's going to be too much pain to try to transition the :active_record load hook from executing against Base to executing against Model. For example, after Model is included in Base, and modules included in Model will no longer get added to the ancestors of Base. So plugins which wish to be compatible with both Model and Base should use the :active_record_model load hook which executes *before* Base gets loaded. In general, ActiveRecord::Model is an advanced feature at the moment and probably most people will continue to inherit from ActiveRecord::Base for the time being.
* Simplify AR configuration code.Jon Leighton2012-06-151-0/+12
| | | | | Get rid of ActiveModel::Configuration, make better use of ActiveSupport::Concern + class_attribute, etc.
* Remove Array.wrap calls in ActiveRecordRafael Mendonça França2012-01-061-2/+2
|
* Revert "Implement ArraySerializer and move old serialization API to a new ↵José Valim2011-11-301-1/+1
| | | | | | | | | | | | | namespace." This reverts commit 8896b4fdc8a543157cdf4dfc378607ebf6c10ab0. Conflicts: activemodel/lib/active_model.rb activemodel/lib/active_model/serializable.rb activemodel/lib/active_model/serializer.rb activemodel/test/cases/serializer_test.rb
* Implement ArraySerializer and move old serialization API to a new namespace.José Valim2011-11-231-1/+1
| | | | | | | | | | | | | The following constants were renamed: ActiveModel::Serialization => ActiveModel::Serializable ActiveModel::Serializers::JSON => ActiveModel::Serializable::JSON ActiveModel::Serializers::Xml => ActiveModel::Serializable::XML The main motivation for such a change is that `ActiveModel::Serializers::JSON` was not actually a serializer, but a module that when included allows the target to be serializable to JSON. With such changes, we were able to clean up the namespace to add true serializers as the ArraySerializer.
* ActiveModel support for the :include serialization optionJohn Firebaugh2011-07-171-39/+1
| | | | | | | | | | | | | | | | | | | | This commit moves support for the :include serialization option for serializing associated objects out of ActiveRecord in into ActiveModel. The following methods support the :include option: * serializable_hash * to_json * to_xml Instances must respond to methods named by the values of the :includes array (or keys of the :includes hash). If an association method returns an object that is_a?(Enumerable) (which AR has_many associations do), it is assumed to be a collection association, and its elements must respond to :serializable_hash. Otherwise it must respond to :serializable_hash itself. While here, fix #858, XmlSerializer should not singularize already singular association names.
* Don't merge base opts into includes when serializing ARsJohn Mileham2011-05-261-6/+2
| | | | | | Conflicts: activerecord/lib/active_record/serialization.rb
* Syntax cleanup: for in => eachGuillermo Iguaran2011-05-191-1/+1
|
* Merge branch 'master' of git://github.com/lifo/docrailsXavier Noria2010-10-061-1/+1
|\
| * Fix serialization :include option nameEvgeniy Dolzhenko2010-10-011-1/+1
| |
* | double negative is not goodNeeraj Singh2010-09-301-1/+1
|/
* fixed some issues with JSON encodingJakub Suder2010-09-071-1/+1
| | | | | | | | | | | - as_json in ActiveModel should return a hash and handle :only/:except/:methods options - Array and Hash should call as_json on their elements - json methods should not modify options argument [#5374 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-1/+1
| | | | 's/[ \t]*$//' -i {} \;)
* Adds title and proper formatting to docs.Rizwan Reza2010-06-161-0/+2
|
* Break up concerns for choosing what attributes should be serialized and the ↵Joshua Peek2009-08-131-41/+39
| | | | actual serializer
* Integrate AMo JSON serializer into ARJoshua Peek2009-07-031-55/+13
|
* Fix AR json encodingJeremy Kemper2009-06-081-2/+3
|
* Cherry-pick core extensionsJeremy Kemper2009-05-131-8/+9
|
* Use Array.wrapJeremy Kemper2009-04-261-4/+4
|
* require json lib when serialization is loadedJoshua Peek2008-11-241-0/+2
|
* Autoload ActiveRecord filesJoshua Peek2008-11-241-1/+1
|
* Improve documentation coverage and markupXavier Noria2008-05-021-5/+5
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Added :include option to to_json (closes #9677) [chuyeow]David Heinemeier Hansson2007-09-281-6/+45
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7663 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added ActiveRecord::Base#to_json/from_json (currently does not support ↵David Heinemeier Hansson2007-09-201-0/+59
:include like to_xml) [DHH]. Added ActiveRecord::Base#from_xml [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7519 5ecf4fe2-1ee6-0310-87b1-e25e094e27de