aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/fixture_set
Commit message (Collapse)AuthorAgeFilesLines
* Move `resolve_sti_reflections` which is table row related code into `TableRow`Ryuta Kamizono2018-11-032-89/+78
|
* Don't pass useless `table_name` to `ModelMetadata.new`Ryuta Kamizono2018-11-032-10/+3
| | | | | | | The `model_metadata` is only used if `model_class` is given. If `model_class` is given, the `table_name` is always `model_class.table_name`.
* Avoid violating key constraints in fixture HABTM associationsJames Le Cuirot2018-10-291-0/+3
| | | | | | | | | When loading fixtures, Ruby 1.9's hash key ordering means that HABTM join table rows are always loaded before the parent table rows, violating foreign key constraints that may be in place. This very simple change ensures that the parent table's key appears first in the hash. Violations may still occur if fixtures are loaded in the wrong order but those instances can be avoided unlike this one.
* Move FixtureSet::ReflectionProxy and FixtureSet::HasManyThroughProxy to ↵Gannon McGibbon2018-10-051-0/+32
| | | | FixtureSet::TableRows
* Introduce FixtureSet::TableRows and FixtureSet::TableRowGannon McGibbon2018-10-052-0/+176
|
* Introduce FixtureSet::ModelMetadataGannon McGibbon2018-10-051-0/+40
|
* Move test_fixtures and render_context to separate filesGannon McGibbon2018-10-031-0/+17
|
* 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
|
* Throw friendly error message when fixture is not a hashKir Shatrov2016-12-151-2/+5
| | | | | | Right now, when fixture is not a Hash we throw an error message saying "fixture is not a hash". This is not very user friendly because it's not saying which fixture is invalid.
* Add three new rubocop rulesRafael Mendonça França2016-08-161-1/+1
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* applies new string literal convention in activerecord/libXavier Noria2016-08-061-6/+6
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* provide file name for fixture ERBDennis Ushakov2016-03-301-1/+7
|
* Merge pull request #20574 from repinel/fix-db-fixtures-loadYves Senn2015-09-301-4/+19
|\ | | | | | | | | | | | | Allow fixtures YAML files to set the model class in the file itself Conflicts: activerecord/CHANGELOG.md
| * Allow fixtures YAML files to set the model class in the file itselfRoque Pinel2015-09-111-2/+13
|/ | | | | | | | Currently, `set_fixture_class` is only available using the `TestFixtures` concern and it is ignored for `rake db:fixtures:load`. Using the correct model class, it is possible for the fixture load to also load the associations from the YAML files (e.g., `:belongs_to` and `:has_many`).
* Introduce a context for rendering fixtures ERB.Victor Costan2013-12-031-1/+2
| | | | | | | | | | Fixture files are passed through an ERB renderer before being read as YAML. The rendering is currently done in the context of the main object, so method definitons leak into other fixtures, and there is no clean place to define fixture helpers. After this commit, the ERB renderer will use a new subclass of ActiveRecord::FixtureSet.context_class each time a fixture is rendered.
* drop errors constantVipul A M2013-03-271-2/+1
|
* Move/rename files to follow naming conventionsAlexey Muranov2012-10-071-0/+56