Carlos Antonio da Silva
7fb536972e
Add ensure block to make sure the state is properly restored
2012-11-04 19:50:56 -02:00
Carlos Antonio da Silva
1fef1bedbc
Remove some line breaks between array items that make the assert file tests harder to read
2012-11-04 19:22:05 -02:00
Carlos Antonio da Silva
ade6c74ba6
Refactor Inflector#ordinal to avoid converting the number twice
2012-11-04 18:51:47 -02:00
Carlos Antonio da Silva
5cdeb5ef7d
Fix typo in test name
2012-11-04 12:07:06 -02:00
Carlos Antonio da Silva
b1fe78e0cb
Raise ArgumentError when no attribute is given to AMo::EachValidator
...
ArgumentError is better suited than RuntimeError for this.
2012-11-04 11:41:05 -02:00
Carlos Antonio da Silva
d9f20c575a
Set hash value instead of using merge!
2012-11-04 11:35:01 -02:00
Carlos Antonio da Silva
f786469f54
Merge pull request #8111 from nikitug/use_tag_instead_of_method_missing_in_xml_builder
...
Use `tag!` instead of `method_missing` in `to_xml` conversions.
2012-11-04 05:03:43 -08:00
Nikita Afanasenko
9cda6a321e
Use tag!
instead of method_missing
in to_xml
conversions.
...
Since version `3.0.x` `Builder` caches method passed to `method_missing` each time. This commit replaces `method_missing` call with `tag!` call to prevent method redefinition on each `to_xml` call with the same builder.
2012-11-04 14:33:39 +04:00
Carlos Antonio da Silva
7c3bc58b54
Ensure nested attributes is restored in case of a test failure
2012-11-03 19:57:35 -02:00
Carlos Antonio da Silva
66bcaff062
Simplify query conditions a bit in nested attributes test
...
Also refactor the test a bit.
2012-11-03 19:56:18 -02:00
Carlos Antonio da Silva
51b901408e
Remove #permitted attr accessor from Parameters
...
There is no need to expose this accessor since we already have the query
method #permitted? that should handle this purpose.
2012-11-03 16:57:19 -02:00
Rafael Mendonça França
fa0aebf320
Check if the options value is present before to send the deprecation
...
message
2012-11-03 13:27:08 -02:00
Rafael Mendonça França
c449462f45
Merge pull request #8108 from Casecommons/fix-multiple-and-index-in-instance-tag
...
Support :multiple option on input tags that also have :index
2012-11-02 15:21:35 -07:00
Daniel Fox, Grant Hutchins & Trace Wax
175ba04cf3
Support :multiple option on input tags with :index
...
When you have an explicit index set, then when you build an input tag
with :multiple => true, it doesn't add [] to the end of its name, although
it should.
2012-11-02 18:14:04 -04:00
Rafael Mendonça França
743d07ea2c
Remove old comment
...
This comment is not valid since that `if` is there to make possible to
do:
remove_index :users, :name
Instead of:
remove_index :users, column: :name
What is a valid use case.
[ci skip]
2012-11-02 20:07:46 -02:00
Rafael Mendonça França
7042fe2f84
Deprecate passing a string as third argument of add_index
...
This was there due historical reasons since
7dc45818dc43c163700efc9896a0f3feafa31138 to give the user the
possibility to create unique indexes passing "UNIQUE" as the third
argument
2012-11-02 20:03:26 -02:00
Santiago Pastorino
96bcef947b
Clear url helpers when reloading routes
2012-11-02 19:10:22 -02:00
Rafael Mendonça França
8fc52706c3
Raise an ArgumentError when passing an invalid option to add_index
...
Closes #8104
2012-11-02 19:00:58 -02:00
Carlos Antonio da Silva
48a7a261c2
Merge pull request #8106 from steveklabnik/fix_grammar
...
Fixed grammar in migration pending error.
2012-11-02 13:51:07 -07:00
Steve Klabnik
6831c61a30
Fixed grammar in migration pending error.
2012-11-02 13:46:56 -07:00
Vijay Dev
3b0bb08699
Merge branch 'master' of github.com:lifo/docrails
...
Conflicts:
actionpack/lib/action_controller/metal/mime_responds.rb
activerecord/lib/active_record/attribute_methods.rb
guides/source/working_with_javascript_in_rails.md
2012-11-03 01:56:16 +05:30
Rafael Mendonça França
974467d70d
Add test to avoid regression of 1bfc5b4
2012-11-02 18:16:27 -02:00
Vijay Dev
ee917493e4
copy edits [ci skip]
2012-11-03 01:41:44 +05:30
Vijay Dev
1c3bdfcda4
Revert "Updated activerecord test comments to new hash syntax"
...
This reverts commit 3b89052014c2bf3b8fbbcfb93f657a17dd7e7ca3.
Reason: changes made to a test, albeit in commented lines - non-uniform
change.
[ci skip]
2012-11-03 01:27:14 +05:30
Vijay Dev
8ffb0dacf9
Revert "dont encourage AC::Parameters#permit_all_parameters usage [ci skip]"
...
This reverts commit cd17ee5598411728747011566abf6779166be9d3.
Reason: Let's note that this is discouraged, not remove the docs
[ci skip]
2012-11-03 01:16:57 +05:30
Rafael Mendonça França
1bfc5b4068
Revert "Merge pull request #7668 from Draiken/fix_issue_6497"
...
This reverts commit f4ad0ebe7a6b17658bddfeb996e3c34835b75623, reversing
changes made to 8b2cbb3a832101f0e672ee309beca0f8c555b292.
Conflicts:
actionpack/CHANGELOG.md
REASON: This added introduced a bug when you have a shorthand route
inside a nested namespace.
See
281367eb77
2012-11-02 14:49:12 -02:00
Rafael Mendonça França
e34d856b8d
Merge pull request #8097 from steveklabnik/issue_8095
...
Fixed mapping of Solomon Islands.
2012-11-01 18:12:47 -07:00
Steve Klabnik
642e1af6f1
Fixed timezone mapping of Solomon Islands.
...
Fixes #8095 .
For reference, here is the discussion about the mapping being
incorrect:
http://rubyforge.org/pipermail/tzinfo-users/2012-November/000114.html
2012-11-01 18:10:48 -07:00
Santiago Pastorino
2e20a7d9f7
Merge pull request #8019 from lest/patch-1
...
memoize calculated ip without additional variable
2012-11-01 13:03:08 -07:00
Sergey Nartimov
43aa2d308c
memoize calculated ip without additional variable
...
There is no need in additional `@calculated_ip` instance variable.
2012-11-01 22:29:21 +03:00
Carlos Antonio da Silva
694334c37a
Fix issue with collection associations and first(n)/last(n)
...
When calling first(n) or last(n) in a collection, Active Record was
improperly trying to set the inverse of instance in case that option
existed. This change was introduced by
fdf4eae506fa9895e831f569bed3c4aa6a999a22.
In such cases we don't need to do that "manually", since the way
collection will be loaded will already handle that, so we just skip
setting the inverse association when any argument is given to
first(n)/last(n).
The test included ensures that these scenarios will have the inverse of
instance set properly.
Fixes #8087 , Closes #8094 .
Squashed cherry-pick from d37d40b and c368b66.
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/associations/collection_association.rb
2012-11-01 14:37:12 -02:00
kennyj
2c4faaaedd
This is comment for singular association.
2012-11-02 01:34:29 +09:00
Carlos Antonio da Silva
69cebae3b2
Merge pull request #8093 from nikitug/keep_app_x_ua_compatible
...
Fix #8086 (BestStandardsSupport rewrites app X-UA-Compatible header)
2012-11-01 04:42:55 -07:00
Nikita Afanasenko
d8c1404107
Fix #8086 (BestStandardsSupport rewrites app X-UA-Compatible header, now appends).
...
Now `BestStandardsSupport` middleware appends it's `X-UA-Compatible` value to app's value.
Also test for `BestStandardsSupport` middleware added.
2012-11-01 15:15:46 +04:00
Carlos Antonio da Silva
b31ea0c240
Add test to ensure data attributes are properly escaped with tag helpers
...
Closes #8091
2012-11-01 08:49:47 -02:00
Santiago Pastorino
c7e233ce47
Merge pull request #8092 from arunagw/warning_removed_unused_var
...
Small change to remove warning unused variable.
2012-10-31 22:17:39 -07:00
Arun Agrawal
d065938663
Small change to remove warning unused variable.
2012-11-01 10:25:20 +05:30
Carlos Antonio da Silva
1e89e43f66
Merge pull request #8026 from steveklabnik/issue_8025
...
Make sure that RAILS_ENV is set when accessing Rails.env
2012-10-31 17:18:45 -07:00
Steve Klabnik
b3125c89f4
Make sure that RAILS_ENV is set when accessing Rails.env
...
Fixes #8025
2012-10-31 17:05:26 -07:00
AvnerCohen
d20a52930a
1.9 hash syntax changes to docs
2012-10-31 21:19:44 +02:00
David Heinemeier Hansson
d349490371
Revert "Don't allocate new strings in compiled attribute methods"
...
This reverts commit f1765019ce9b6292f2264b4601dad5daaffe3a89.
2012-10-31 17:04:08 +01:00
David Heinemeier Hansson
750a30b19f
No need for the debugger
2012-10-31 16:35:20 +01:00
David Heinemeier Hansson
954c350daf
Allow #permit to take its list of permitted parameters as an array
2012-10-31 16:33:54 +01:00
Guillermo Iguaran
4b20cd9c66
Revert "if format is unknown NullMimeTypeObject is returned"
...
This reverts commit a8560fa361958b33d76e4468eb5c07d82a20196e.
2012-10-31 10:01:39 -05:00
Carlos Antonio da Silva
9fdf606954
Remove extre count, preheat already happens during setup
2012-10-31 12:54:07 -02:00
Carlos Antonio da Silva
92bae4929d
Merge pull request #8073 from alexisbernard/fix_find_in_batches_start_option
...
Fix find_in_batches against string IDs when start option is not specified
2012-10-31 07:49:42 -07:00
Alexis Bernard
a58cafeb3a
Fix find_in_batches against string IDs when start option is not specified.
2012-10-31 15:39:24 +01:00
Rafael Mendonça França
6a6909dc29
Merge pull request #8084 from acapilleri/format_never_nil
...
if format is unknown NullMimeTypeObject is returned
2012-10-31 07:08:27 -07:00
Angelo capilleri
a8560fa361
if format is unknown NullMimeTypeObject is returned
...
If a unknown format is passed in a request, the methods html?, xml?, json? ...etc
Nil Exception.
This patch add a class NullMimeTypeObject, that is returned when request.format is unknown
and it responds false to the methods that ends with '?'.
It refers to #7837 , not fixes because it's not considered a improvement not a bug.
2012-10-31 15:07:37 +01:00
Carlos Antonio da Silva
6569709881
Merge pull request #8078 from nikitug/serialized_attributes_before_type_cast
...
Fix `attributes_before_type_cast` for serialized attributes.
2012-10-31 04:09:58 -07:00