Commit Graph

36 Commits

Author SHA1 Message Date
Ryuta Kamizono
1dc17e7b2e Fix CustomCops/AssertNot to allow it to have failure message
Follow up of #32605.
2018-05-13 11:32:47 +09:00
Kir Shatrov
831be98f9a Use frozen-string-literal in ActiveRecord 2017-07-19 22:27:07 +03:00
Matthew Draper
87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
2017-07-02 02:15:17 +09:30
Kir Shatrov
cfade1ec7e Enforce frozen string in Rubocop 2017-07-01 02:11:03 +03:00
Rafael Mendonça França
55f9b8129a
Add three new rubocop rules
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces

Fix all violations in the repository.
2016-08-16 04:30:11 -03:00
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
Tara Scherner de la Fuente
926a24a751 remove args from assert_nothing_raised in tests 2016-02-22 22:56:23 -08:00
Gaurav Sharma
29efc6ee05 remove old unavailable link with relevant fix 2015-03-23 11:18:14 +05:30
Arun Agrawal
9ae210ba09 Build fix when running in isolation
`Computer` class needs to be require

See #17217 for more details
2014-11-14 10:24:11 +01:00
Jenner LaFave
5de7309b7b Add support for module-level table_suffix in models
This makes table_name_suffix work the same as table_name_prefix when
using namespaced models. Pretty much the same as 67d1cec.
2014-05-05 12:41:26 -07:00
Guo Xiang Tan
3baace687c Use teardown helper method.
Follow-Up to https://github.com/rails/rails/pull/14348

Ensure that SQLCounter.clear_log is called after each test.

This is a step to prevent side effects when running tests. This will allow us to run them in random order.
2014-03-14 20:48:59 -07:00
Aaron Patterson
da06ae88ab add missing require 2013-10-02 17:04:02 -07:00
Jon Leighton
b658cf1198 Deprecate ActiveRecord::Base.scoped.
It doesn't serve much purpose now that ActiveRecord::Base.all returns a
Relation.

The code is moved to active_record_deprecated_finders.
2012-07-27 17:27:47 +01:00
Jon Leighton
3981a687f9 remove deprecated calls 2012-04-27 14:28:36 +01:00
Jon Leighton
df6f971e3a %s/find(:\(first\|last\|all\), \([^()]*\))/scoped(\2).\1/gcI amongst other things 2012-04-27 11:42:50 +01:00
Jon Leighton
75f03eca75 remove calls to find(:first), find(:last) and find(:all) 2012-04-26 18:32:55 +01:00
Jon Leighton
1ad138cf4b fix tests 2012-04-13 18:26:19 +01:00
Jon Leighton
a2dab46cae Deprecate inferred JOINs with includes + SQL snippets.
See the CHANGELOG for details.

Fixes #950.
2012-01-16 21:32:12 +00:00
Jon Leighton
d13627d532 Revert "Deprecate implicit eager loading. Closes #950."
This reverts commit c99d507fccca2e9e4d12e49b4387e007c5481ae9.
2012-01-16 21:17:17 +00:00
Jon Leighton
c99d507fcc Deprecate implicit eager loading. Closes #950. 2011-12-29 14:27:33 +00:00
Aaron Patterson
61774e0d49 please use ruby -I lib:test path/to/test.rb, or export RUBY_OPT 2011-06-06 15:47:13 -07:00
Jon Leighton
253bb6b926 Refactor Active Record test connection setup. Please see the RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases. 2011-06-04 23:47:03 +01:00
Aaron Patterson
839f3bf682 just use a hash for doing association caching 2011-01-07 11:28:11 -08:00
Santiago Pastorino
b451de0d6d Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;) 2010-08-14 04:12:33 -03:00
Neeraj Singh
ce20b93606 assert_equal should be used instead of assert
[#4629 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-18 16:13:00 +02:00
Andrew White
9cea9bc7f0 Refactor compute_type to handle situations where the correct class is already loaded
Signed-off-by: wycats <wycats@gmail.com>
2010-04-12 21:31:20 -07:00
Andrew White
67d1cec4c8 Add the ability to specify table_name_prefix on individual modules
Signed-off-by: wycats <wycats@gmail.com>
2010-03-28 23:43:28 -07:00
David Heinemeier Hansson
1459c8cc1d Changed ActiveRecord::Base.store_full_sti_class to be true by default reflecting the previously announced Rails 3 default [DHH] 2010-01-03 19:30:28 -08:00
Dmitry Ratnikov
314ba0433f Changed to use klass instead of constantizing in assign_ids generated method
[#260 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 02:52:06 -07:00
Dmitry Ratnikov
f16008afdd Modified Rich Bradley's test-case to fail as part of suite and with a reasonable message
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 02:40:27 -07:00
Rich Bradley
9bb8ef9ede Fix for nested :include with namespaced models.
[#260 state:committed]
2009-08-09 00:31:46 -07:00
Josh Peek
4b68982f64 Improve ActiveRecord::Base#table_name unit tests for nested classes. Closes #10289. [scott_willson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9237 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-04-07 19:44:37 +00:00
Jeremy Kemper
39814fcce0 Merge branch 'ar-test-cleanup' of git://git.geeksomnia.com/rails
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8681 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-21 17:20:51 +00:00
Jeremy Kemper
1e70928014 Fix paths
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8661 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:31:37 +00:00
Jeremy Kemper
42b39ae3f2 Move tests to cases
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8660 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:30:42 +00:00