Commit Graph

42576 Commits

Author SHA1 Message Date
Arthur Neves
7058321725
Change usec to 0 on tests that compare seconds
Avoid rounding problems with `.usec` method rounding the seconds when the
field doesn't persist the `.usec` piece.
2014-03-12 11:52:39 -04:00
Arthur Neves
66d61ab63b
Unit test for mysql quote time usec 2014-03-12 11:50:50 -04:00
Rafael Mendonça França
591b8f395d Merge pull request #13040 from kamipo/case_sensitive_comparison
Only use BINARY for mysql case sensitive uniqueness check when column has a case insensitive collation.

Conflicts:
	activerecord/CHANGELOG.md
2014-03-12 10:51:10 -03:00
Rafael Mendonça França
79ceae6241 Merge pull request #14359 from arthurnn/mysql2_56_franc_sec
MySQL 5.6  Fractional Seconds
2014-03-12 10:24:50 -03:00
Arthur Neves
2ed1cbba52
Changelog entry for mysql56 microseconds 2014-03-12 09:20:22 -04:00
Arthur Neves
5a934e6787
Test microsecond on mysql 5.6 2014-03-12 09:06:12 -04:00
Tatsuhiko Miyagawa
df5a38fc6a MySQL 5.6 and later supports microsecond precision in datetime.
You might want to branch it to include this only for 5.6, but
passing these values to < 5.6 doesn't cause issues either.
2014-03-12 09:02:20 -04:00
Yves Senn
7bbdb076c0 Merge pull request #14291 from laurocaetano/doc-for-original-fullpath
Add documentation for original_fullpath. [ci skip]
2014-03-12 08:41:45 +01:00
Lauro Caetano
0d191baa82 [ci skip] Add documentation for original_fullpath. 2014-03-11 20:11:53 -03:00
Rafael Mendonça França
7e21be3c29 Merge pull request #14353 from arthurnn/remove_small_mock
Remove mocking on save, when not necessary
2014-03-11 15:16:42 -03:00
Arthur Neves
3c23f76844
Remove mocking on save, when not necessary 2014-03-11 14:07:29 -04:00
Godfrey Chan
ccaf0ed791 Merge pull request #14345 from arthurnn/revert_14052
Fixes STI when 2+ levels deep.
2014-03-11 07:25:36 -07:00
Yves Senn
6868265fe3 comment why we are modifying global state. [ci skip] 2014-03-11 08:34:51 +01:00
Yves Senn
3f5339f48e change_table supports citext. Follow up to #12523. 2014-03-11 08:27:59 +01:00
Yves Senn
0e0b41d58c Merge pull request #12523 from lsylvester/pg_citext
Support for PostgreSQL citext data type.
2014-03-11 08:19:25 +01:00
Jeremy Kemper
47ea87b8b9 Merge pull request #14342 from zuhao/eliminate_global_state_leak_in_activemodel_tests
Eliminate global state leaks completely in ActiveModel tests
2014-03-10 20:04:56 -07:00
Carlos Antonio da Silva
80b27c2ae4 Merge pull request #11616 from arunagw/removed-application-command-rails
Removed command "application"
2014-03-10 19:32:58 -03:00
Arun Agrawal
9e61a14d4b Removed unnecessary command "application" 2014-03-10 23:23:12 +01:00
lsylvester
b3e0da3062 register OID for PostgreSQL citex datatype [Troy Kruthoff & Lachlan Sylvester]
citext makes it possible to use AR Hash finders for case-insensitive matching as sql UPPER/LOWER functions are not needed.
2014-03-11 08:14:03 +11:00
Arthur Neves
e5f15a8365
Fixes STI when 2+ levels deep.
PR #14052 Added a regression where it was only looking for methods in one
level up, So when the method was defined in a 2+ levels up the
inheritance chain, the method was not found as defined.
2014-03-10 14:10:46 -04:00
Vijay Dev
d41154094a Merge pull request #14343 from garysweaver/master
minor fix to 4.1 rel notes for begin_transaction joinable option
2014-03-10 23:07:25 +05:30
Zuhao Wan
cc6bc1cc46 Completely remove potential global state leaks in ActiveModel tests.
ActiveModel tests can now be run in random order.
2014-03-11 00:48:25 +08:00
Gary S. Weaver
2c634f01fa minor fix to 4.1 rel notes for begin_transaction joinable option [CI skip] 2014-03-10 12:42:06 -04:00
Rafael Mendonça França
6e3ab3e15f Merge pull request #8313 from alan/only_save_changed_has_one_objects
Save has_one associations only if record has changes

Conflicts:
	activerecord/CHANGELOG.md
2014-03-10 11:41:55 -03:00
Rafael Mendonça França
39e07b64ce current_adapter? accepts multiple arguments 2014-03-10 11:09:39 -03:00
Rafael Mendonça França
d50f75367b mysql adapter also fails with a number bigger than int 2014-03-10 11:07:10 -03:00
Rafael Mendonça França
a1ad848469 The 4.1 release notes is already a thing so lets show in the guides
links
2014-03-10 10:32:16 -03:00
Rafael Mendonça França
d547b23754 Change the assertions depending in the database adapter
This will avoid the confusing flunk logic
2014-03-10 10:23:17 -03:00
Rafael Mendonça França
18b9595814 Do proper adapter check 2014-03-10 10:20:27 -03:00
Rafael Mendonça França
0e5fb0ba9c Whitespaces 2014-03-10 10:08:00 -03:00
Yves Senn
8db0afe2a8 Merge pull request #14341 from keikun17/master
fix minor typo 'fields_for'. [ci skip]
2014-03-10 13:27:17 +01:00
Cakey | Buddy Magsipoc
b87962f3a8 Fix 'fields_for' doc typo. 2014-03-10 20:10:38 +08:00
Yves Senn
ed9a69a8fb Merge pull request #14332 from tgxworld/autosave_association_test
Delete instances of Parrot after each test.
2014-03-10 08:30:26 +01:00
Guo Xiang Tan
5ade4b0593 Cleanup Parrot after each test. 2014-03-09 20:37:31 -07:00
Godfrey Chan
740862a202 Merge pull request #14334 from kennym/master
Enhance readability of ActionView DateHelper#distance_of_time_in_words
2014-03-09 19:47:09 -07:00
Kenny Meyer
b5dc91deaa Enhance readability of ActionView DateHelper#distance_of_time_in_words
Refactor numerical constants to module constants which give the numbers
a contextual meaning. This commit aims to provide quicker understanding
for part of the implementation of the
DateHelper#distance_of_time_in_words method.
2014-03-09 21:54:01 -03:00
Yves Senn
29bd586fed Merge pull request #14315 from zuhao/activemodel_tests_in_random_order
Run ActiveModel test suites in random order.
2014-03-09 21:03:13 +01:00
Zuhao Wan
9ffeb36265 Run ActiveModel test suites in random order.
This gets the whole ActiveModel test suites working even if
`self.i_suck_and_my_tests_are_order_dependent!` is disabled
in `ActiveSupport::TestCase`.

Two places are found that potentially leak global state. This patch
makes sure states are restored so that none of the changes happen in
a single test will be carried over to subsequence tests.
2014-03-10 03:52:51 +08:00
Andrew White
ec23277124 Merge pull request #14262 from sferik/flat_map
Replace additional instances of map.flatten with flat_map
2014-03-09 10:04:57 +00:00
Carlos Antonio da Silva
45efd0ebf7 Move changelog entry to the top, highlight module name [ci skip] 2014-03-08 18:20:45 -03:00
Andrew White
af4c9b78ff Copy shallow options from normal options when using scope
If the options :shallow_prefix and :shallow_path are not set in the
scope options then copy them from the normal :as and :path options
if they are set.
2014-03-08 19:51:06 +00:00
Andrew White
8711086f5a Pull namespace defaults out of the options hash
If a developer has specified either :path or :as in the options hash then
these should be used as the defaults for :shallow_path and :shallow_prefix.

Fixes #14241.
2014-03-08 19:51:06 +00:00
Andrew White
dcc91a04a1 Only use shallow nested scope when depth is > 1
By tracking the depth of resource nesting we can push the need for nested
shallow scoping to only those routes that are nested more than one deep.
This allows us to keep the fix for #12498 and fix the regression in #14224.

Fixes #14224.
2014-03-08 19:51:06 +00:00
Andrew White
ed0fb4ae7e Move setting :scope_level_resource to resource_scope
Originally with_scope_level was exclusively for managing scope levels with
resources, however it is now used for other things so it makes more sense
to move the responsibility for setting the :scope_level_resource to the
resource_scope method. This eliminates repeatedly setting it to the same
resource as each resource method scope is evaluated.
2014-03-08 19:51:06 +00:00
Yves Senn
002c0634d1 Merge pull request #14313 from m-Peter/active_model_doc_fixes
Fix errors for four of the code samples [ci skip]
2014-03-08 20:30:42 +01:00
Peter Markou
f6ab778297 Fix errors for four of the code samples
The four code samples that fail to run are:

- Add attribute magic to objects. Fixed by introducing a Person
  instance variable.

- Tracking value changes. Fixed by replacing `attr_accessor` with
  `define_attribute_methods`, providing getter and setter methods
  for `name` and providing the missing `Person#save` method. A
  call to `Person#save` has to precede the `person.name = 'robert'`
  assignment, if we want `previous_changes` to include 'bob'.

- Adding `errors` interface to objects. Fixed by introducing a
  Person instance variable, assigning `nil` to its name and calling
  `Person#validate!`.

- Custom validators. Fixed by defining `HasNameValidator` before
  it is used by `ValidatorPerson`.

All the code samples can now be run smoothly.

Call Dirty#changes_applied in Person#save, instead of modifying instance vars.
2014-03-08 21:19:42 +02:00
Santiago Pastorino
1fbb9056ef Merge pull request #14325 from robin850/issue-12133
Make the rails:template rake task load initializers
2014-03-08 16:15:12 -02:00
Santiago Pastorino
18c651659e Merge pull request #14244 from arthurnn/orderd_hash_select_fix
Fix OrderedHash.select to return self instance.
2014-03-08 16:12:10 -02:00
Santiago Pastorino
2af7a7b19c Merge pull request #14280 from joho/make_csrf_failure_logging_optional
Make CSRF failure logging optional/configurable.
2014-03-08 15:22:42 -02:00
Robin Dupret
9c53b8b89f Make the rails:template rake task load initializers
Templates could rely on irregular inflections or external libraries for
instance so we should load the application's initializers when running
the rails:template task.

The introducing commit of this feature is f7f11361 ; the initializers
have never been loaded invoking this task.

Fixes #12133.
2014-03-08 15:59:22 +01:00