aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/fixtures.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* | Fix lookup of fixtures with non-string labelPrathamesh Sonpatki2015-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | - Fixtures with non-string labels such as integers should be accessed using integer label as key. For eg. pirates(1) or pirates(42). - But this results in NotFound error because the label is converted into string before looking up into the fixtures hash. - After this commit, the label is converted into string only if its a symbol. - This issue was fount out while adding a test case for https://github.com/rails/rails/commit/7b910917.
* | Fix TypeError in Fixture creationMatt Hogan2015-01-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ruby 4.2 started doing `value.gsub('$LABEL', label)` for fixture label interpolation, but you can have have valid YAML where `label` isn't a String. For example: ```YAML 0: name: John email: johndoe@gmail.com 1: name: Jane email: janedoe@gmail.com ``` This YAML will create a label that is a Fixnum, causing `TypeError: no implicit conversion of Fixnum into String.`
* | Remove deprecated `ActiveRecord::Fixtures` constantRafael Mendonça França2015-01-041-6/+0
| |
* | Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-291-3/+3
| |
* | Fix build failuresSean Griffin2014-11-221-1/+3
| | | | | | | | | | | | | | | | | | | | For some reason changing `.find` to `.unscoped.find` in https://github.com/rails/rails/commit/f766abd4cf3eb75469d3646cfb6d85e668c619f3 caused `scoping` to leak in some tests when run in isolation (looks like a concurrency issue?). `relation_scoping_test.rb` is a case that failed. From what I can tell it should not be possible, but changing to the block form fixes it. There is a deeper issue that I can't seem to find. /cc @senny
* | make it possible to access fixtures excluded by a `default_scope`.Yves Senn2014-11-211-1/+1
| | | | | | | | | | | | | | | | Prior to this patch you'd end up with an error like: ``` ActiveRecord::RecordNotFound: Couldn't find <Model> with 'id'=<id> [WHERE (<default_scope condition>)] ```
* | Avoid unnecessary allocations/callsPablo Herrero2014-11-021-1/+1
|/
* Merge pull request #17014 from grosser/grosser/fast-fixturesAaron Patterson2014-10-101-34/+2
|\ | | | | speed up fixtures by not loading all their classes
| * speed up fixtures by not loading all their classesgrosser2014-10-061-34/+2
| |
* | Use Hash#each_key instead of Hash#keys.eachErik Michaels-Ober2014-09-291-1/+1
|/ | | | | | Hash#keys.each allocates an array of keys; Hash#each_key iterates through the keys without allocating a new array. This is the reason why Hash#each_key exists.
* fix fixtures not loading if a belongs_to association is defined with a ↵Will Bryant2014-09-221-1/+1
| | | | :foreign_key option that's a symbol
* Updated comment about features of fixturesPrathamesh Sonpatki2014-09-191-0/+3
| | | | | | - Added a note about some features which are not dependent on auto-generated ID's. - [ci skip]
* extract updating all fixture cache to a method so we can lock laterAaron Patterson2014-09-031-1/+5
|
* [ci skip] Fix example code of ActiveRecord::FixtureSet.context_classyuuji.yaginuma2014-08-291-1/+1
|
* don't log errors when all is finePeter Schröder2014-07-171-5/+5
|
* Move uuid_v5 and uuid_v3 to Digest::UUIDRafael Mendonça França2014-07-151-2/+2
| | | | | These methods are not random so they should not belings to SecureRandom module.
* Revert code changes at "Copy edits and code font wrap for Active Record [ci ↵Rafael Mendonça França2014-06-131-1/+7
| | | | | | | | skip]" This partially reverts commit 1a203d5e07f639332880099fab610b886b1742fc. Reason: It was committed by accident
* Copy edits and code font wrap for Active Record [ci skip]Zachary Scott2014-06-131-15/+11
|
* Remove deprecation warningAkshay Vishnoi2014-06-111-4/+0
|
* remove deprecation call while initializing `ClassCache` objectKuldeep Aggarwal2014-06-111-7/+1
|
* Merge branch 'master' of github.com:rails/docrailsVijay Dev2014-06-071-3/+4
|\
| * [ci skip] remove double "in your"schneems2014-06-041-1/+1
| |
| * [ci skip] less derogatory explanation of defaultsschneems2014-06-021-2/+3
| |
| * [ci skip] fix "note" syntaxschneems2014-06-021-1/+1
| |
* | fix polymorphic? method and reuse iteileencodes2014-06-021-1/+1
|/ | | | | | Fix polymorphic to check for `options[:polymorphic]` instead of `options.key? :polymorphic` and then reuse the method `polymorphic?` method instead of constantly checking the same `options[:polymorphic]`.
* Merge pull request #15210 from arthurnn/fix_hbtm_reflectionArthur Neves2014-05-241-1/+1
| | | | | | | | | Fix habtm reflection Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/counter_cache.rb activerecord/lib/active_record/reflection.rb activerecord/test/cases/reflection_test.rb
* No need to call sendRafael Mendonça França2014-04-101-1/+1
|
* Merge pull request #12016 from roderickvd/uuid_fixesRafael Mendonça França2014-04-041-9/+24
|\ | | | | | | | | | | | | | | | | | | Auto-generate stable fixture UUIDs on PostgreSQL Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/fixtures.rb activerecord/test/cases/adapters/postgresql/uuid_test.rb activesupport/CHANGELOG.md
| * Auto-generate stable fixture UUIDs on PostgreSQL.Roderick van Domburg2014-01-071-9/+24
| | | | | | | | Fixes: #11524
* | Extend fixture label replacement to allow string interpolationEric Steele2014-03-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows fixtures to use their $LABEL as part of a string instead of limiting use to the entire value. mark: first_name: $LABEL username: $LABEL1973 email: $LABEL@$LABELmail.com users(:mark).first_name # => mark users(:mark).username # => mark1973 users(:mark).email # => mark@markmail.com
* | Fixed typo in comment about MAX_ID.Vajrasky Kok2014-02-231-1/+1
| |
* | Update deprecation warning to give more information about callerT.J. Schuck2014-01-161-2/+2
| |
* | Revert "ask the fixture set for the sql statements"Aaron Patterson2014-01-091-12/+10
|/ | | | | | | | | This reverts commit 026d0555685087845b74dd87a0417b5a164b1c13. Conflicts: activerecord/lib/active_record/fixtures.rb Fixes #13383
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2013-12-201-1/+1
|\
| * Typos. return -> returns. [ci skip]Lauro Caetano2013-12-031-1/+1
| |
* | Introduce a context for rendering fixtures ERB.Victor Costan2013-12-031-0/+32
|/ | | | | | | | | | 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.
* ask the fixture set for the sql statementsAaron Patterson2013-11-041-10/+12
|
* remove HABTM special cases from the fixturesAaron Patterson2013-10-021-12/+0
|
* let the class cache object clean up user inputAaron Patterson2013-09-091-8/+20
|
* Fix fixtures regression that required table names to map to classes only, ↵Jeremy Kemper2013-09-081-1/+1
| | | | not class names
* use polymorphic proxies to remove duplicate codeAaron Patterson2013-09-061-24/+43
|
* reduce duplication somewhatAaron Patterson2013-09-061-14/+14
|
* make the duplicate code more similarAaron Patterson2013-09-061-4/+10
|
* auto link hm:t fixture join tables like habtmAaron Patterson2013-09-061-0/+16
|
* don't depend on object state when reading fixture filesAaron Patterson2013-09-061-8/+7
|
* ensure @model_class is initializedAaron Patterson2013-09-061-0/+1
|
* no need to dupAaron Patterson2013-09-051-1/+1
|
* push logic outside the FixtureSet constructorAaron Patterson2013-09-051-3/+3
|
* only construct the FixtureSet with AR modelsAaron Patterson2013-09-051-2/+11
|
* push constant lookup in the a cache objectAaron Patterson2013-09-051-2/+21
|