Commit Graph

41818 Commits

Author SHA1 Message Date
Yves Senn
40a83d740f typo fix in test name. [ci skip]. 2014-01-08 11:15:59 +01:00
Yves Senn
e37f16444a core_ext/string/access.rb test what we are documenting.
I also extracted the tests from a single bulk method into a separate test-case.
The new tests cover the API described in the docs.

There are two skipped tests, which are broken as of 2ef1fb2c455ca53a0c1e1768f50824926ce28bd3
* #to with negative Fixnum, position is counted from the end
* #from and #to can be combined

This was brought to my attention by #13627.

Closes #13627.
2014-01-08 10:25:40 +01:00
Rafael Mendonça França
f12413295b Merge pull request #13355 from dylanahsmith/migration-version
activerecord: Initialize Migration with version from MigrationProxy.

Conflicts:
	activerecord/CHANGELOG.md
2014-01-07 18:44:51 -02:00
Xavier Noria
032ab5064b Merge pull request #13621 from Intrepidd/patch-1
Fix typo in image_tag documentation [ci skip]
2014-01-07 03:48:25 -08:00
Adrien
98c3586415 Fix typo in image_tag documentation
image_tag only supports :alt and :size as additional keys, not three.
2014-01-07 12:38:24 +01:00
Yves Senn
ab21f42245 Merge pull request #13597 from prathamesh-sonpatki/hstore_migration
Make change_table use object of current database adapter
2014-01-07 03:08:03 -08:00
Nishant Modak
eb589fed6f Make change_table use object of current database adapter
- Earlier, change_table was creating database-agnostic object.
  - After this change, it will create correct object based on current
    database adapter.
  - This will ensure that create_table and change_table will get same objects.
  - This makes update_table_definition method public and nodoc.
  - Fixes #13577 and #13503
2014-01-07 15:57:21 +05:30
Carlos Antonio da Silva
3a33e8ea85 Use a better method name to check the requirement of password confirmation
Also improve changelog entries related to secure password to proper
highlight.
2014-01-07 07:59:44 -02:00
Rafael Mendonça França
017b0fb08a Merge pull request #13617 from arthurnn/error_var
Add 'e' var on rescue DalliError, in order to log it
2014-01-06 09:50:58 -08:00
Arthur Neves
f3748c886a Add 'e' var on rescue DalliError, in order to log it 2014-01-06 12:47:47 -05:00
Dylan Thacker-Smith
06ace1e2b5 activerecord: Initialize Migration with version from MigrationProxy. 2014-01-06 10:46:35 -05:00
Rafael Mendonça França
ca98d0d486 Merge pull request #13616 from zirni/remove_warnings
Remove warnings in test suite
2014-01-06 07:44:14 -08:00
Matthias Zirnstein
2a0fdde380 Remove warnings in test suite
lib/active_record/store.rb:79: warning: method redefined; discarding old color=
lib/active_record/store.rb:79: warning: previous definition of color= was here
lib/active_record/store.rb:83: warning: method redefined; discarding old color
lib/active_record/store.rb:83: warning: previous definition of color was here
2014-01-06 16:40:32 +01:00
Yves Senn
f2b80a41b5 Merge pull request #13593 from oliveiraethales/store_yaml_coder
Fix: ActiveRecord::Store TypeError conversion when using YAML coder
2014-01-06 05:43:14 -08:00
Thales Oliveira
901a0c8b4a Fix: ActiveRecord::Store TypeError conversion when using YAML coder
Renaming the test accordingly to its behaviour

Adding 'Fixes' statement to changelog

Improving tests legibility & changelog

Undoing mistakenly removed empty line & further improving changelog
2014-01-06 11:36:19 -02:00
Yves Senn
2d1d426c67 add example to the CHANGELOG entry from 3a48b83e5 [ci skip].
/cc @pixeltrix
2014-01-06 14:18:53 +01:00
Carlos Antonio da Silva
6bf93b22d5 Fix typo in AS changelog, improve highlight [ci skip] 2014-01-06 10:28:44 -02:00
Carlos Antonio da Silva
5d238ea926 Fix AR connection resolver docs to return a hash with string keys [ci skip] 2014-01-06 09:15:11 -02:00
Carlos Antonio da Silva
28161b7c88 Fix typo [ci skip] 2014-01-06 09:07:44 -02:00
Carlos Antonio da Silva
16a27b68ea Fix rdoc markup [ci skip]
Wrapping symbols with + does not work, we must use <tt> instead.
2014-01-06 08:50:33 -02:00
Yves Senn
1ce0a2a68a Merge pull request #13611 from robinboening/plugin_generator_tests
Add missing tests for invalid names in `rails plugin new` generator
2014-01-06 02:49:40 -08:00
Carlos Antonio da Silva
a6da73f975 Fix typo in AMo docs [ci skip] 2014-01-06 08:45:21 -02:00
Robin Böning
6cc087b28d Add missing tests for invalid names in rails plugin new
* Test for: Invalid plugin name, because of reserved rails word.
* Test for: Invalid plugin name because of constant name that is already in use.
2014-01-06 11:28:04 +01:00
Yves Senn
535bd55fcd quick formatting pass through CHANGELOGS. [ci skip]. 2014-01-06 10:57:00 +01:00
Yves Senn
2229c523aa update 4.1 release notes with deprecation commit link. [ci skip] 2014-01-06 10:00:40 +01:00
Guillermo Iguaran
ad142aed49 Merge pull request #13607 from huoxito/actionview-version
Require actionview/version
2014-01-05 21:55:55 -08:00
Washington Luiz
a5d92e6a1d Require actionview/version
just like all the other modules do require their version file
2014-01-06 02:52:46 -03:00
Rafael Mendonça França
d2cee1e4cc Merge pull request #13604 from randomecho/docs-getting-started
Ruby is a proper noun here, not part of code fragment [ci skip]
2014-01-05 16:41:32 -08:00
Soon Van
44473e49a8 Ruby is a proper noun here, not part of code fragment [ci skip]
Last line of note also relates heavily to first part
and parenthesis broke reading flow.
2014-01-05 18:42:14 -05:00
Andrew White
3a48b83e5e Allow an absolute controller path inside a module scope
Fixes #12777
2014-01-05 19:58:04 +00:00
Andrew White
a1564d470d Add CHANGELOG entry for #10634 [ci skip] 2014-01-05 19:23:53 +00:00
Andrew White
ffc273577a Merge pull request #10634 from teleological/time_advance_gregorian
Maintain proleptic gregorian in Time#advance
2014-01-05 11:19:00 -08:00
Rafael Mendonça França
6e867a4dfe Merge pull request #13598 from zirni/remove_ar_warnings
Remove method redefined warnings for test suite

Closes #13526
2014-01-05 09:24:34 -08:00
Matthias Zirnstein
bf556880f2 Remove method redefined warnings for test suite
has_many definitions with "name" as singular and as plural e.g.
  has_many :welcome_posts_with_comment
  has_many :welcome_posts_with_comments

Ruby mentions it with:

lib/active_record/associations/builder/collection_association.rb:65:
  warning: method redefined; discarding old welcome_posts_with_comment_ids
lib/active_record/associations/builder/collection_association.rb:65:
  warning: previous definition of welcome_posts_with_comment_ids was here
lib/active_record/associations/builder/collection_association.rb:75:
  warning: method redefined; discarding old welcome_posts_with_comment_ids=
lib/active_record/associations/builder/collection_association.rb:75:
  warning: previous definition of welcome_posts_with_comment_ids= was here
2014-01-05 18:18:07 +01:00
Gaelian Ditchburn
7a085dac2a Switched to use display:none in extra_tags_for_form method.
The use of `display:inline` with the content_tag call in the
extra_tags_for_form method potentially causes display issues with some
browsers, namely Internet Explorer. IE's behaviour of not collapsing
the line height on divs with ostensibly no content means that the
automatically added div containing the hidden authenticity_token, utf8
and _method form input tags may interfere with other visible form
elements in certain circumstances. The use of `display:none` rather
than `display:inline` fixes this problem.

Fixes #6403
2014-01-05 17:16:22 +00:00
Andrew White
6b54883082 Unique the segment keys array for non-optimized url helpers
In Rails 3.2 you only needed pass an argument for dynamic segment once so
unique the segment keys array to match the number of args. Since the number
of args is less than required parts the non-optimized code path is selected.
This means to benefit from optimized url generation the arg needs to be
specified as many times as it appears in the path.

Fixes #12808
2014-01-05 11:57:50 +00:00
Andrew White
892c539591 Show full route constraints in error message
When an optimized helper fails to generate, show the full route constraints
in the error message. Previously it would only show the contraints that were
required as part of the path.

Fixes #13592
2014-01-05 10:27:46 +00:00
Andrew White
b9efc74f9e Simplify arg parameterization 2014-01-05 08:43:12 +00:00
Andrew White
d017e92e1d Use a custom route vistor for optimized route generation
Using a Regexp to replace dynamic segments in a path string is fraught
with difficulty and can lead to odd edge cases like #13349. Since we
already have a parsed representation of the path it makes sense to use
that to generate an array of segments that can be used to build an
optimized route's path quickly.

Tests on a simple route (e.g. /posts/:id) show a speedup of 35%:
https://gist.github.com/pixeltrix/8261932

Calculating -------------------------------------
    Current Helper:       5274 i/100ms
    New Helper:           8050 i/100ms
-------------------------------------------------
    Current Helper:     79263.6 (±3.7%) i/s -     395550 in   4.997252s
    New Helper:        153464.5 (±4.9%) i/s -     772800 in   5.047834s

Tests on a more complex route show even an greater performance boost:
https://gist.github.com/pixeltrix/8261957

Calculating -------------------------------------
    Current Helper:       2367 i/100ms
    New Helper:           5382 i/100ms
-------------------------------------------------
    Current Helper:     29506.0 (±3.2%) i/s -     149121 in   5.059294s
    New Helper:         78815.5 (±4.1%) i/s -     398268 in   5.062161s

It also has the added benefit of fixing the edge cases described above.

Fixes #13349
2014-01-05 00:36:25 +00:00
Rafael Mendonça França
339ce7fe9d Merge pull request #13590 from kuldeepaggarwal/fix-date-helper-doc
provide correct example of `datetime_select` helper [ci skip]
2014-01-04 11:21:53 -08:00
Andrew White
3713e43366 Add preview_path to autoload_paths in after_initialize
Only config.autoload_paths is frozen, so add the preview_path
to ActiveSupport::Dependencies.autoload_paths directly in an
after_initialize block. Also protect against a blank preview_path
being added to autoload_paths which can cause a serious slowdown
as Dir[] tries to load all *_preview.rb files under /

Fixes #13372
2014-01-04 18:42:34 +00:00
Kuldeep Aggarwal
e9bfeb0c79 provide correct example of datetime_select helper [ci skip] 2014-01-04 23:59:20 +05:30
Robin Dupret
81066b1158 Merge pull request #13587 from kud86/change_truncate_examples
Fixed truncate documentation. [ci skip]
2014-01-04 04:04:12 -08:00
Konstantin Wlasow
9882ec4a50 Fixed documentation. [ci skip] 2014-01-04 16:18:16 +06:00
Jon Leighton
27bcec28bf Fix mergefail in changelog
The line was duplicated
2014-01-04 09:30:01 +00:00
Jon Leighton
9ea54b2d8e Add deprecation I accidentally missed 2014-01-04 09:29:20 +00:00
Xavier Noria
77d18edf0d Merge pull request #13584 from tjschuck/cannot_cannot_be_can_not
Change all "can not"s to the correct "cannot"
2014-01-03 14:37:04 -08:00
T.J. Schuck
72bb3fc297 Change all "can not"s to the correct "cannot". 2014-01-03 17:02:31 -05:00
Guillermo Iguaran
88c3fd1ef1 Merge pull request #13583 from arthurnn/mem_cache_store_fix
mem_cache_store requires dalli, so only accept dalli/client
2014-01-03 13:43:16 -08:00
Arthur Neves
e7f56a7fe8 Raise if MemCacheStore doenst receive a Dalli obj
:mem_cache_store should receive a list of hosts or a dalli client,
otherwise raise it.
Also adding a changelog.
2014-01-03 16:39:50 -05:00