Commit Graph

51451 Commits

Author SHA1 Message Date
Rafael Mendonça França
3a8656bfd1 Merge pull request #20341 from vngrs/remove_already_defined_methods_in_rack_request
Remove already defined methods in super class of ActionDispatch::Request class
2015-05-28 22:28:21 -03:00
Rafael Mendonça França
b8b7c2f52f Merge pull request #20346 from repinel/remove-mocha2
Remove use of mocha from Active Model
2015-05-28 22:23:05 -03:00
Rafael Mendonça França
10719e1c66 Merge pull request #20267 from kaspth/fix-minitest-constant-clashing
Avoid E constant clashing with Minitest defined version.
2015-05-28 22:21:45 -03:00
Rafael Mendonça França
57f51f090a Merge pull request #20350 from kddeisz/enumerable_pluck
Add Enumerable#pluck.
2015-05-28 22:13:22 -03:00
Rafael Mendonça França
9aa416d3c8 Merge pull request #20347 from repinel/fix-reflection-shadowing
Fix the shadowing warning for `reflection`
2015-05-28 22:09:32 -03:00
Kevin Deisz
d909211736 Add Enumerable#pluck.
Allows fetching the same values from arrays as from ActiveRecord associations.
2015-05-28 20:41:03 -04:00
Roque Pinel
9b986eadf4 Fix the shadowing warning for reflection 2015-05-28 19:10:52 -05:00
Roque Pinel
5a6ae7f753 Remove use of mocha from Active Model 2015-05-28 18:35:17 -05:00
Sean Griffin
2f9d88954c Persist user provided default values, even if unchanged
This is a usability change to fix a quirk from our definition of partial
writes. By default, we only persist changed attributes. When creating a
new record, this is assumed that the default values came from the
database. However, if the user provided a default, it will not be
persisted, since we didn't see it as "changed". Since this is a very
specific case, I wanted to isolate it with the other quirks that come
from user provided default values. The number of edge cases which are
presenting themselves are starting to make me wonder if we should just
remove the ability to assign a default, in favor of overriding
`initialize`. For the time being, this is required for the attributes
API to not have confusing behavior.

We had to delete one test, since this actually changes the meaning of
`.changed?` on Active Record models. It now specifically means
`changed_from_database?`. While I think this will make the attributes
API more ergonomic to use, it is a subtle change in definition (though
not a backwards incompatible one). We should probably figure out the
right place to document this. (Feel free to open a PR doing that if
you're reading this).

/cc @rafaelfranca @kirs @senny

This is an alternate implementation of #19921.

Close #19921.

[Sean Griffin & Kir Shatrov]
2015-05-28 16:40:26 -06:00
Sean Griffin
a6e3cdae0c Allow proc defaults with the Attributes API
This is a variant implementation of the changes proposed in #19914.
Unlike that PR, the change in behavior is isolated in its own class.
This is to prevent wonky behavior if a Proc is assigned outside of the
default, and it is a natural place to place the behavior required by #19921
as well.

Close #19914.

[Sean Griffin & Kir Shatrov]
2015-05-28 16:26:49 -06:00
Rafael Mendonça França
73aab036ee Merge pull request #20017 from eliotsykes/configurable-static-index-filename
config.static_index configures directory Index "index.html" filename
2015-05-28 18:53:00 -03:00
Rafael Mendonça França
233ceda594 Merge pull request #20331 from arunagw/arunagw-remove-unused-package-tasks
Remove unused package tasks
2015-05-28 18:48:21 -03:00
Lauro Caetano
3b727898eb Merge pull request #20344 from jcockhren/fix_docs_presence_validation
removed erroneous line. Corrected presence validation example.
2015-05-28 17:49:41 -03:00
Jurnell Cockhren
d30f0011a9 removed erroneous line. Corrected presence validation example.
Addresses #20343.
Removes erroneous line of code in the sample codeblock.
2015-05-28 15:03:37 -05:00
Mehmet Emin İNAÇ
9a16a29f40 Remove already defined methods in super class of ActionDispatch::Request class
These methods had defined in 2004 by dhh in initial commit and `ActionDispatch::Request`
class has been inherited from `Rack::Request` class in 2009 by josh.
In 2014 these methods and more of them defined in `Rack::Request` class
so we don't need them anymore in rails codebase.
2015-05-28 20:59:21 +03:00
Arthur Nogueira Neves
0920576610 Merge pull request #20313 from s3ymd/master
[ci skip] Fix block parameter of assert_no_difference
2015-05-28 14:52:23 +02:00
Santiago Pastorino
172e452e0a Merge pull request #20336 from vngrs/deprecate_nothing_option_for_render_method
Deprecate `:nothing` option for render method
2015-05-28 09:23:51 -03:00
Hiromichi Yamada
a227e88017 [ci skip] Fix block parameter of assert_no_difference 2015-05-28 21:20:01 +09:00
Mehmet Emin İNAÇ
44781b6e97 Deprecate :nothing option for render method
`head` method works similar to `render` method with `:nothing` option
2015-05-28 15:13:32 +03:00
Arun Agrawal
207f8fc7de Merge pull request #20332 from henders/shender/changelog_reload_credit
Give credit to extra contributor for Base.reload fix
2015-05-28 11:35:18 +02:00
Shane Hender
87b07ef003 Give credit to extra contributor for Base.reload fix 2015-05-28 10:25:50 +01:00
Eliot Sykes
3ff39494cd config.static_index configures directory index "index.html" filename
Set `config.static_index` to serve a static directory index file not
named `index`. For example, to serve `main.html` instead of `index.html`
for directory requests, set `config.static_index` to `"main"`.
2015-05-28 09:41:00 +01:00
Arun Agrawal
21b6b68f63 Remove unused package tasks
We are using `all:build` now.
2015-05-28 09:06:10 +02:00
Rafael Mendonça França
7cc9754209 Merge pull request #20196 from huoxito/preload-association-and-merges
Properly append preload / includes args on Merger
2015-05-28 01:52:14 -03:00
Washington Luiz
a01d164b94 Properly append preload / includes args on Merger
Couldn't find other way to get the association name from a given class
other than looping through `reflect_on_all_associations` reflections ..

Noticed this one while looking at this example:

```ruby
class Product < ActiveRecord::Base
  has_many :variants
  has_many :translations
end

class Translation < ActiveRecord::Base
  belongs_to :product
end

class Variant < ActiveRecord::Base
  belongs_to :product
end

class BugTest < Minitest::Test
  def test_merge_stuff
    product = Product.create! name: 'huhu'
    variant = Variant.create! product_id: product.id
    Translation.create! locale: 'en', product_id: product.id

    product_relation = Product.all
                              .preload(:translations)
                              .joins(:translations)
                              .merge(Translation.where(locale: 'en'))
                              .where(name: 'huhu')

    assert_equal variant, Variant.joins(:product).merge(product_relation).first
  end
end
```
2015-05-28 01:49:34 -03:00
Rafael Mendonça França
be18476fb2 Merge pull request #20263 from arunagw/aa-remove-custom-lines-actionview
Remove custom `lines` and use `/tools/line_statistics`
2015-05-28 01:10:47 -03:00
Rafael Mendonça França
8cc5150065 Merge pull request #20041 from akshay-vishnoi/sqlite_collation
SQLite3: Add collation support for string and text columns
2015-05-28 00:38:15 -03:00
Rafael Mendonça França
add9500eb8 Add test to 57daaef 2015-05-28 00:37:21 -03:00
Jordan Raine
57daaef86a Allow Relation#compact using delegation 2015-05-28 00:35:04 -03:00
Akshay Vishnoi
3932912a59 Add collation support for string and text columns in SQLite3 2015-05-28 08:40:40 +05:30
Rafael Mendonça França
902360b77f Merge pull request #20329 from EduardoBautista/json-api-support
Add application/vnd.api+json alias to the JSON MIME Type.
2015-05-27 23:55:45 -03:00
Rafael Mendonça França
d81f147003 Merge pull request #20171 from georgeclaghorn/enums-in-fixtures
Allow the use of symbols or strings to specify enum values in test fixtures
2015-05-27 23:52:37 -03:00
Eduardo Bautista
50b66313ad Add application/vnd.api+json alias to the JSON MIME Type. 2015-05-27 21:51:04 -05:00
Rafael Mendonça França
1ed92a2ee1 Merge pull request #19886 from henders/henders/reload_wipe_query_cache
Cause ActiveRecord::Base::reload to also ignore the QueryCache.
2015-05-27 23:45:55 -03:00
Rafael Mendonça França
c68e45dd3b Merge pull request #17654 from kamipo/strict_mode_explicitly
If specify `strict: :default` explicitly, do not set sql_mode.
2015-05-27 23:35:05 -03:00
George Claghorn
908cfef6e2 Resolve enums in test fixtures
Currently, values for columns backing Active Record enums must be
specified as integers in test fixtures:

    awdr:
      title: "Agile Web Development with Rails"
      status: 2

    rfr:
      title: "Ruby for Rails"
      status: <%= Book.statuses[:proposed] %>

This is potentially confusing, since enum values are typically
specified as symbols or strings in application code. To resolve the
confusion, this change permits the use of symbols or strings to specify
enum values:

    awdr:
      status: :published

It is compatible with fixtures that specify enum values as integers.
2015-05-27 21:48:58 -04:00
Rafael Mendonça França
27fdf4591d Merge pull request #20269 from wojobucco/master
Changed mysqldump to include sprocs and functions
2015-05-27 22:43:23 -03:00
Rafael Mendonça França
a75f6cfb1b Merge pull request #20326 from hderms/dh/fix_task_bug
Fix rake method definition leaking onto Object
2015-05-27 22:19:57 -03:00
Rafael Mendonça França
4b606d0713 💣 Fix another leftover 2015-05-27 21:59:00 -03:00
Rafael Mendonça França
6b1e67e1a1 Fix file name
This is a leftover of #19867
2015-05-27 21:48:01 -03:00
Rafael Mendonça França
f02f287242 Merge pull request #19808 from byroot/action-parameter
[PoC] Stop shadowing parameters named `action`
2015-05-27 21:43:45 -03:00
Rafael Mendonça França
99c042b3cc Merge pull request #19867 from radar/rename-app-rails-loader
Remove redundant 'Rails' from Rails::AppRailsLoader constant
2015-05-27 21:41:06 -03:00
Zachary Scott
7a9651cf1b Merge pull request #20327 from yoongkang/ajax
[ci-skip] Replace dead link about HttpOnly cookies.
2015-05-27 17:36:31 -07:00
Yoong Kang Lim
ad6e508039 [ci skip] Replace dead link about HttpOnly cookies. 2015-05-28 10:35:54 +10:00
Dermot Haughey
ae5c3c3514 add fixed file
add framework_test

add another test
2015-05-27 19:24:47 -05:00
Rafael Mendonça França
3e36db4406 Merge pull request #20316 from vngrs/add_assertion_for_get_method_into_request_test
Add assertion for get? method into test cases
2015-05-27 18:05:05 -03:00
Rafael Mendonça França
1f8a9d953d Merge pull request #20321 from vngrs/fix_indentation_warning
Fix indentation warning on active_support ordered_options
2015-05-27 18:02:30 -03:00
Claudio B.
ffa20f1479 Merge pull request #20323 from jakegavin/initialization-guide-update
Remove unnecessary reference to example Blog app in initialization guides
2015-05-27 12:48:24 -07:00
Jake Gavin
c9f05c92a5 Remove unnecessary reference to example Blog app [ci skip] 2015-05-27 12:24:06 -07:00
Rafael Mendonça França
8acf0cc382 Merge pull request #20319 from kassio/master
Remove web-console and spring from test group on default Gemfile.
2015-05-27 15:08:47 -03:00