Commit Graph

40916 Commits

Author SHA1 Message Date
Kuldeep Aggarwal
fff0309081 unnecessary checking of size with second regex if matched with first one 2013-11-27 15:51:47 +05:30
Yves Senn
260471a5e1 Merge pull request #13071 from kuldeepaggarwal/documentation-updation
[ci skip]removed obsolete information about `options` parameter in create method
2013-11-27 00:42:06 -08:00
Kuldeep Aggarwal
e1042ee399 [ci skip]removed obsolete information about options parameter in create method 2013-11-27 13:53:19 +05:30
Yves Senn
c65f8d2243 Merge pull request #13070 from kuldeepaggarwal/documentation-updation
[ci skip] used new syntax for scopes
2013-11-27 00:15:26 -08:00
Kuldeep Aggarwal
c29124c4bd [ci skip] used new syntax for scopes 2013-11-27 12:23:23 +05:30
Rafael Mendonça França
5fdbec7dd1 Merge pull request #13061 from laurocaetano/fix-uniqueness-validation-for-aliased-attribute
Fix bug when validating the uniqueness of an aliased attribute.
Conflicts:
	activerecord/CHANGELOG.md
2013-11-26 20:54:19 -02:00
Jeremy Kemper
f7e4e37ae7 Merge pull request #12183 from chancancode/json_encoder_refactor
JSON encoder refactor
2013-11-26 13:22:27 -08:00
Akira Matsuda
93c74e1b4d More typo fixes 2013-11-27 03:56:12 +09:00
Godfrey Chan
262e2e1188 Be explicit and use the actual unicode sequence 2013-11-26 09:51:51 -08:00
Godfrey Chan
6ef53181eb Process::Status should get a :nodoc: [ci skip] 2013-11-26 09:51:51 -08:00
Godfrey Chan
d4ef6c0029 Make the JSON encoder pluggable 2013-11-26 09:51:51 -08:00
Godfrey Chan
80e7552073 Removed the Ruby encoder and switched to using the JSON gem
Got all the tests passing again.

Support for `encode_json` has been removed (and consequently the
ability to encode `BigDecimal`s as numbers, as mentioned in the
previous commit). Install the `activesupport-json_encoder` gem
to get it back.
2013-11-26 09:51:51 -08:00
Godfrey Chan
4d02296cfb Removed support for encoding BigDecimal as a JSON number
This is because the new encoder will no longer support encode_json.
Therefore our only choice is to return `to_i` or `to_s` in
`BigDecimal#as_json`. Since casting a BigDecimal to an integer is
most likely a lossy operation, we chose to encode it as a string.

Support for encoding BigDecimal as a string will return via the
`activesupport-json_encoder` gem.
2013-11-26 09:51:51 -08:00
Godfrey Chan
ca12db0efb Expanded coverage on JSON encoding 2013-11-26 09:50:59 -08:00
Godfrey Chan
cfaa2aa99f Added some failing tests where the JSON encoder is not resolving as_json correctly 2013-11-26 09:50:59 -08:00
Akira Matsuda
499b602c8e Minor typo fixes 2013-11-27 02:27:38 +09:00
Carlos Antonio da Silva
42c28544e1 Add branch to arel in Gemfile so that we can use local repos [ci skip] 2013-11-26 13:58:55 -02:00
Yves Senn
d35678242c Merge pull request #13018 from heruku/scoping_fix
changed update counter to act on unscoped model
2013-11-26 07:16:17 -08:00
heruku
45d4d141f9 changed update counter to act on unscoped model 2013-11-26 09:04:03 -06:00
Rafael Mendonça França
3669704050 Merge pull request #13049 from senny/remove_firebird_tests
remove leftover firebird adapter tests.
2013-11-26 06:51:22 -08:00
Yves Senn
36053ce92c sync example and documentation for strong_parameters hash whitelisting.
[ci skip]

This is a follow up to #12609 and integrates #12158.

Thanks @aspiers.
Closes #12158.
2013-11-26 14:50:44 +01:00
Akira Matsuda
c7f1bcd23b tyop 2013-11-26 21:55:28 +09:00
Yves Senn
e161aeab17 remove leftover firebird adapter tests. 2013-11-26 11:05:37 +01:00
Yves Senn
6eba8d27e6 rename_index: add the new index before removing the old one.
This prevents the following error when a MySQL index on a foreign key
column is renamed:

```
ActiveRecord::StatementInvalid: Mysql2::Error: Cannot drop index 'index_engines_on_car_id': needed in a foreign key constraint: DROP INDEX `index_engines_on_car_id` ON `engines`
```

refs: #13038.
2013-11-26 10:03:55 +01:00
Rafael Mendonça França
e4c0a225ae Merge pull request #13042 from brianstorti/fix-dependent-destroy-12812
Raise `RecordNotDestroyed` when children can't be replaced
2013-11-25 17:48:59 -08:00
Brian Thomas Storti
09f941c507 move changelog entry to the top 2013-11-25 23:17:31 -02:00
Brian Thomas Storti
5aab0c0538 Raise RecordNotDestroyed when children can't be replaced
Fixes #12812
Raise `ActiveRecord::RecordNotDestroyed` when a child marked with
`dependent: destroy` can't be destroyed.

The following code:
```ruby
class Post < ActiveRecord::Base
  has_many :comments, dependent: :destroy
end

class Comment < ActiveRecord::Base
  before_destroy do
    return false
  end
end

post = Post.create!(comments: [Comment.create!])
post.comments = [Comment.create!]
````

would result in a `post` with two `comments`.
With this commit, the same code would raise a `RecordNotDestroyed`
exception, keeping the `post` with the same `comment`.
2013-11-25 19:30:07 -02:00
Aaron Patterson
19dd216610 require the files we test 2013-11-25 11:33:31 -08:00
Rafael Mendonça França
a6900a2073 Merge pull request #13034 from vipulnsward/some_typos
Fix some minor typos
2013-11-25 10:49:35 -08:00
Vipul A M
82de1eda7c Fix some minor typos [ci skip] 2013-11-26 00:13:35 +05:30
Carlos Antonio da Silva
b2c7d2345f Revert "Merge pull request #13027 from akshay-vishnoi/f-refactor"
This reverts commit f4a5a9ea4d183f4102796215d4502c46dbe3e52b, reversing
changes made to 7ccb482181ee6c47c765406009018a15172812de.

Reason:

The logic is different, the first call to #option_value_selected? is for
the :selected option (the argument is the "selected" variable), the second
call is for the :disabled option (the argument is the "disabled" variable).
2013-11-25 09:32:32 -02:00
Yves Senn
f4a5a9ea4d Merge pull request #13027 from akshay-vishnoi/f-refactor
avoiding calling of #option_value_selected? two times
2013-11-25 02:21:57 -08:00
Akshay Vishnoi
0f2ef7b929 avoiding calling of #option_value_selected? two times 2013-11-25 15:36:27 +05:30
Yves Senn
7ccb482181 Merge pull request #13029 from akshay-vishnoi/documentation
`delgated` => `delegated`
2013-11-25 00:47:59 -08:00
Akshay Vishnoi
5a406ff42e delgated => delegated 2013-11-25 14:09:44 +05:30
Yves Senn
051a520b8c Merge pull request #13025 from pwnall/nice_test
Better error message for typos in assert_response argument.
2013-11-25 00:10:45 -08:00
Victor Costan
c759a93454 Better error message for typos in assert_response argument.
This commit makes it really easy to debug errors due to typos like
"assert_response :succezz".
2013-11-25 03:09:02 -05:00
Yves Senn
9dc89f3fc4 Merge pull request #13026 from vipulnsward/document_rewhere
Added `rewhere` usage to AR querying guides
2013-11-24 23:56:32 -08:00
Vipul A M
66087189c1 Added rewhere usage to AR querying guides 2013-11-25 12:00:46 +05:30
Carlos Antonio da Silva
587c2d67ce Merge pull request #13020 from razielgn/raise-inspectable-messages
Raise RuntimeErrors with inspectable and MRI-independent messages.
2013-11-24 13:57:19 -08:00
Xavier Noria
17c29a0df0 Merge remote-tracking branch 'docrails/master'
Conflicts:
	activesupport/lib/active_support/core_ext/hash/deep_merge.rb
	activesupport/lib/active_support/core_ext/hash/keys.rb
2013-11-24 20:00:24 +01:00
Xavier Noria
28a6a7ea3b a couple of copy-edits before merging [ci skip] 2013-11-24 19:55:46 +01:00
Rafael Mendonça França
b4b30c048d Merge pull request #13021 from razielgn/rbx-gemfile-and-travis-fixes
Updated allow_failures for Rubinius 2.2.1.
2013-11-24 07:26:12 -08:00
Federico Ravasio
f12099313c Updated allow_failures for Rubinius 2.2.1. 2013-11-24 16:15:22 +01:00
Rafael Mendonça França
c459e225a8 Merge pull request #13019 from razielgn/rbx-gemfile-and-travis-fixes
Rubinius Gemfile and travis fixes
2013-11-24 07:05:58 -08:00
Federico Ravasio
5541cdcf88 Properly fix Rubinius dependencies in Gemfile & Travis integration.
Before Rubinius 2.2.0, some parts of the stdlib were lazily loaded, even
if not included in the Gemfile. Now it's 100% required to include the
gem 'rubysl', otherwise the stdlib is not available entirely, breaking
everything.

Also, the rubysl-test-unit gem was depending on minitest ~> 4.7, thus causing
conflicts with Rails's dependency on minitest 5. That is not the case
anymore since rubysl-test-unit 2.0.2, so it is completely safe to
include it fully.

When Travis is going to update RVM to 1.24, it'll be safe to use rbx-2,
thus picking new versions automatically.
2013-11-24 14:38:18 +01:00
Federico Ravasio
0bc95ed95a Raise RuntimeErrors with inspectable and MRI-independent messages.
Previous behaviour was MRI-dependent, now we're making sure the message
is correctly shown: something that can be relyied upon across every
Ruby implementation.
2013-11-24 14:18:00 +01:00
Guillermo Iguaran
a0f1e6a27a Merge pull request #13016 from arunagw/test-for-skip-assets-controller
Test for when controller with skip-assets
2013-11-23 08:22:03 -08:00
Arun Agrawal
bd00feec4f Test for when controller with skip-assets 2013-11-23 17:17:18 +01:00
Yves Senn
69883f3ebf Merge pull request #13015 from arunagw/task-creation-command-test
Added test when task generator called on revoke
2013-11-23 08:05:43 -08:00