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

10 commits

Author SHA1 Message Date
Xavier Noria
d22e522179 modernizes hash syntax in activerecord 2016-08-06 19:37:57 +02:00
Xavier Noria
9617db2078 applies new string literal convention in activerecord/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 18:26:53 +02:00
Yves Senn
152b85f06c introduce conn.data_source_exists? and conn.data_sources.
These new methods are used from the Active Record model layer to
determine which relations are viable to back a model. These new methods
allow us to change `conn.tables` in the future to only return tables and
no views. Same for `conn.table_exists?`.

The goal is to provide the following introspection methods on the
connection:

* `tables`
* `table_exists?`
* `views`
* `view_exists?`
* `data_sources` (views + tables)
* `data_source_exists?` (views + tables)
2015-09-22 19:48:44 +02:00
Sean Griffin
3bc314e658 Move writing unknown column exception to null attribute
Making this change revealed several subtle bugs related to models with
no primary key, and anonymous classes. These have been fixed as well,
with regression tests added.
2014-06-26 09:43:35 -06:00
Carlos Antonio da Silva
965b779eb2 Add some coverage for AR serialization with serializable_hash
ActiveRecord json/xml serialization should use as base
serializable_hash, provided by ActiveModel. Add some more coverage
around options :only and :except for both json and xml serialization.
2012-06-22 08:28:03 -03:00
Jon Leighton
50d395f96e Raise error when using write_attribute with a non-existent attribute.
Previously we would just silently write the attribute. This can lead to
subtle bugs (for example, see the change in AutosaveAssociation where a
through association would wrongly gain an attribute.

Also, ensuring that we never gain any new attributes after
initialization will allow me to reduce our dependence on method_missing.
2011-09-13 00:01:58 +01:00
Aaron Patterson
df07760486 introduce a fake AR adapter for mocking database return values 2011-02-04 13:34:57 -08:00
Aaron Patterson
ee34b4cf34 share column cache among subclasses, only look up columns per AR::Base subclass once 2011-02-01 14:25:46 -08:00
Lawrence Pit
60504e62c8 to_xml with :include should skip_instruct on the included records [#4506 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-30 14:22:57 +02:00
Jeremy Kemper
43b81d01d0 move assets and models
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8657 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:27:03 +00:00
Renamed from activerecord/test/fixtures/contact.rb (Browse further)