aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/store.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add saved changes helpers for store accessorsVladimir Dementyev2019-03-251-1/+21
|
* Add dirty methods for store accessorspalkan2019-03-251-0/+28
|
* Update prefix and allow suffix options for store accessorsYukio Mizuta2018-06-121-5/+21
|
* Add custom prefix to ActiveRecord::Store accessorsTan Huynh2018-03-231-5/+20
| | | | | | Add a prefix option to ActiveRecord::Store.store_accessor and ActiveRecord::Store.store. This option allows stores to have identical keys with different accessors.
* Add MySQL JSON reference to ActiveRecord::Store documentationSaverio Miroddi2018-03-171-2/+2
| | | | | | The current documentation explicitly mentions only PostgreSQL (hstore/json) for use with `.store_accessor`, making it somewhat confusing what to choose on a MySQL 5.7+ setup (which introduced a json data type).
* Avoid extra calls to to_sDaniel Colson2018-01-291-1/+1
| | | | | | | With #31615 `type_for_attribute` accepts either a symbol as well as a string. `has_attribute?` and `attribute_alias` also accept either. Since these methods call `to_s` on the argument, we no longer need to do that at the call site.
* 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
|
* Report the attribute on ActiveRecord::SerializationTypeMismatchKir Shatrov2017-01-291-3/+3
|
* Privatize unneededly protected methods in Active RecordAkira Matsuda2016-12-241-4/+3
|
* code gardening: removes redundant selfsXavier Noria2016-08-081-2/+2
| | | | | | | | | A few have been left for aesthetic reasons, but have made a pass and removed most of them. Note that if the method `foo` returns an array, `foo << 1` is a regular push, nothing to do with assignments, so no self required.
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-24/+24
|
* applies new string literal convention in activerecord/libXavier Noria2016-08-061-2/+2
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* applies new doc guidelines to Active Record.Yves Senn2015-10-141-2/+3
| | | | | | | | | | | | | | | | | | | 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
* Fix type case of "validations" and word-wrap from #17954 [ci skip]Zachary Scott2014-12-081-2/+3
|
* Add note to Store about uniqueness validation (#17954) [skip ci]Mike Chau2014-12-081-1/+4
|
* add missing `:nodoc:` to `store.rb`. [ci skip]Yves Senn2014-06-241-4/+4
|
* Remove unneeded `@column_types` instance variableSean Griffin2014-06-221-1/+1
| | | | This was used more previously, but other uses have been removed.
* Fix inheritance of stored_attributes (fixes #14672)Jessica Yao2014-05-141-5/+14
| | | | [Brad Bennett, Jessica Yao, & Lakshmi Parthasarathy]
* Fix: ActiveRecord::Store TypeError conversion when using YAML coderThales Oliveira2014-01-061-1/+1
| | | | | | | | | | Renaming the test accordingly to its behaviour Adding 'Fixes' statement to changelog Improving tests legibility & changelog Undoing mistakenly removed empty line & further improving changelog
* improve Active Record Store docs when using PG types. [ci skip].Yves Senn2013-11-091-3/+4
|
* Fix typo in AR store docs [ci skip]Carlos Antonio da Silva2013-11-091-1/+1
|
* Merge branch 'master' of github.com:rails/docrailsVijay Dev2013-11-071-0/+4
|\
| * refine usage docs of `store` in combination with `hstore` and `json`.Yves Senn2013-11-061-3/+3
| | | | | | | | refs #11561 #12700
| * Hstore and JSON fields are not supported with storeRobin Dupret2013-10-301-0/+4
| | | | | | | | | | The use of `store` on Hstore fields (for instance) is not needed because serialization aimed to interact with Ruby objects and not with provided field types
* | `ActiveRecord::Store` works together with PG `hstore` columns.Yves Senn2013-10-251-14/+46
| | | | | | | | | | | | This is necessary because as of 5ac2341 `hstore` columns are always stored as `Hash` with `String` keys. `ActiveRecord::Store` expected the attribute to be an instance of `HashWithIndifferentAccess`, which led to the bug.
* | `stored_attributes` need to be specific to a subclass.Yves Senn2013-10-251-0/+3
|/ | | | | | | | | | | | | | | | | Currently they are all stored globally in the same `Hash`. This commit forces the creation of a per-class variable if necessary. The behavior was exposed through the following test-case: ``` 1) Failure: StoreTest#test_all_stored_attributes_are_returned [/Users/senny/Projects/rails/activerecord/test/cases/store_test.rb:151]: --- expected +++ actual @@ -1 +1 @@ -[:color, :homepage, :favorite_food] +[:resolution, :color, :homepage, :favorite_food] ```
* define Active Record Store accessors in a moduleSergey Nartimov2013-02-111-12/+21
| | | | | | | | | | | | | Allow store accessors to be overrided like other attribute methods, e.g.: class User < ActiveRecord::Base store :settings, accessors: [ :color, :homepage ], coder: JSON def color super || 'red' end end
* Namespace HashWithIndifferentAccessAkira Matsuda2013-01-071-3/+3
|
* refactor store_accessorMatt Jones2012-09-131-6/+38
|
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-09-091-1/+1
|\ | | | | | | | | Conflicts: activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
| * add :nodoc: to AR::Store::IndifferentCoder [ci skip]Francesco Rodriguez2012-09-081-1/+1
| |
* | correctly flag changed attributes in AR::Store, combine multiple calls to ↵Matt Jones2012-09-051-2/+3
|/ | | | store_accessor
* Use instance_accessor: false instead of instance_writer.kennyj2012-08-211-1/+1
|
* load active_support/core_ext/class/attribute in active_support/railsXavier Noria2012-08-021-1/+0
|
* load active_support/concern in active_support/railsXavier Noria2012-08-021-1/+0
|
* Avoid to call send(store_attribute) twice.kennyj2012-07-151-6/+8
|
* Remove duplicated code in the AR::Store.kennyj2012-07-141-11/+3
|
* Added *instance_writer: false* for stored/serialized attributes.kennyj2012-07-071-1/+1
|
* Don't mark the store as changed if an attribute isn't changed.kennyj2012-07-031-2/+5
|
* Refactor and use class_attributeCarlos Antonio da Silva2012-06-181-3/+5
|
* Remember the stored attributes in a config attribute.Joost Baaij2012-06-181-0/+12
| | | | | | This allows you to retrieve the list of attributes you've defined. Usable for e.g. selects in the view, or interators based on the attributes you wish to store in the serialized column.
* Fixed typo.chrismcc2012-06-111-1/+1
|
* Fix backward compatibility with stored Hash values. Wrap coders to convert ↵Jeremy Kemper2012-05-301-2/+32
| | | | serialized values to indifferent access.
* Convert Hash to HashWithIndifferentAccess in ActiveRecord::Store.Andrey Voronkov2012-05-221-10/+27
| | | | | | | In order to make migration from 3.x apps easier, we should try to convert Hash instances to HashWithIndifferentAccess, to allow accessing values with both symbol and a string. This is follow up to changes in 3c0bf043.
* Copy edit [ci skip]Rafael Mendonça França2012-05-131-3/+4
|
* Custom coders support for ActiveRecord::Store. JSON, YAML, Marshal can be ↵Andrey Voronkov2012-05-091-5/+10
| | | | used out of the box.
* Merge pull request #4856 from ihid/store_null_bugAaron Patterson2012-02-021-0/+2
|\ | | | | Allow store to be a not null column.
| * Allow store to be a not null column.Jeremy Walker2012-02-021-0/+2
| |