| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changes:
* Update `include_root_in_json` default value to false for default value
to false for `ActiveModel::Serializers::JSON`.
* Remove unnecessary change to include_root_in_json option in
wrap_parameters template.
* Update `as_json` documentation.
* Fix JSONSerialization tests.
Problem:
It's confusing that AM serializers behave differently from AR,
even when AR objects include AM serializers module.
class User < ActiveRecord::Base; end
class Person
include ActiveModel::Model
include ActiveModel::AttributeMethods
include ActiveModel::Serializers::JSON
attr_accessor :name, :age
def attributes
instance_values
end
end
user.as_json
=> {"id"=>1, "name"=>"Konata Izumi", "age"=>16, "awesome"=>true}
# root is not included
person.as_json
=> {"person"=>{"name"=>"Francesco", "age"=>22}}
# root is included
ActiveRecord::Base.include_root_in_json
=> false
Person.include_root_in_json
=> true
# different default values for include_root_in_json
Proposal:
Change the default value of AM serializers to false, update
the misleading documentation and remove unnecessary change
to false of include_root_in_json option with AR objects.
class User < ActiveRecord::Base; end
class Person
include ActiveModel::Model
include ActiveModel::AttributeMethods
include ActiveModel::Serializers::JSON
attr_accessor :name, :age
def attributes
instance_values
end
end
user.as_json
=> {"id"=>1, "name"=>"Konata Izumi", "age"=>16, "awesome"=>true}
# root is not included
person.as_json
=> {"name"=>"Francesco", "age"=>22}
# root is not included
ActiveRecord::Base.include_root_in_json
=> false
Person.include_root_in_json
=> false
# same behaviour, more consistent
Fixes #6578.
|
|\
| |
| | |
Updated guide to say Rails 4.0 requires 1.9.3 or higher, not Rails 3.2.
|
| | |
|
|\ \
| |/
|/| |
a test case that ensures AR::Relation#merge can merge associations
|
|/ |
|
|
|
|
|
|
| |
just a consolidation of the changelogs with minimal formatting
[ci skip]
|
|\ |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| | |
From the Pull Request #6461
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This reverts commits 911a0859ac065aa8e8834ac985353d659c7c7b65 and
30b31f51af6f7094c4a27b086755fc66c368d6fa.
Reason: these changes make the Active Model tests fail randomly.
Some examples:
http://travis-ci.org/#!/rails/rails/jobs/1498992
http://travis-ci.org/#!/rails/rails/jobs/1496948
http://travis-ci.org/#!/rails/rails/jobs/1489985
This script was used to reproduce these breaks:
https://gist.github.com/f6828a03ee4d40bffbc3
200 times, 0 failures
|
| |
| |
| |
| |
| | |
Similarly to 6525002, this allows to use routes helpers for mounted
helpers, but this time in ActionView::TestCase
|
| | |
|
| |
| |
| |
| | |
Correct the use of to_model in polymorphic routing
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In integration tests, you might want to use helpers from engines that
you mounted in your application. It's not hard to add it by yourself,
but it's unneeded boilerplate. mounted_helpers are now included by
default. That means that given engine mounted like:
mount Foo::Engine => "/foo", :as => "foo"
you will be able to use paths from this engine in tests this way:
foo.root_path #=> "/foo"
(closes #6573)
|
|\ \
| | |
| | | |
remove unneeded blank line from !namespeced? generated controllers
|
|/ / |
|
|\ \
| | |
| | | |
Revert "Only include Rake::DSL if it's defined."
|
| | |
| | |
| | |
| | |
| | |
| | | |
This reverts commit 82c3aca17e78d25f217702e530586673f2a219d7.
Reason: Ruby 1.9.3 is shipped with Rake > 0.9
|
|\ \ \
| | | |
| | | | |
improve readability of AR explain result
|
|/ / / |
|
|\ \ \
| |/ /
|/| | |
modulize AR::NullRelation
|
| | | |
|
|/ /
| |
| |
| | |
now we can invoke previously added scope extension methods
|
| | |
|
|\ \
| | |
| | |
| | |
| | |
| | | |
* master-sec:
Strip [nil] from parameters hash. Thanks to Ben Murphy for reporting this!
predicate builder should not recurse for determining where columns. Thanks to Ben Murphy for reporting this
|
| | |
| | |
| | |
| | |
| | |
| | | |
Thanks to Ben Murphy for reporting this!
CVE-2012-2660
|
| | |
| | |
| | |
| | |
| | |
| | | |
Thanks to Ben Murphy for reporting this
CVE-2012-2661
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
jeremyf/extract-force-ssl-filter-logic-to-separate-method
Extracted redirect logic from ActionController::Force::ClassMethods.forc...
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Prior to this patch the existing .force_ssl method handles both defining
the filter and handling the logic for performing the redirect.
With this patch the logic for redirecting to the HTTPS protocol is
separated from the filter logic that determines if a redirect should
occur. By separating the two levels of behavior, an instance method
for ActionController (i.e. #force_ssl_redirect) is exposed and available
for more granular SSL enforcement.
Cleaned up indentation.
|
| | | |
| | | |
| | | |
| | | | |
Eliminate the warnings generated by redefining methods and constants.
|
|\ \ \ \
| |/ / /
|/| | | |
Add code statistics for Javascript and CoffeeScript files
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
CoffeeScript files to `rake stats` task
Orignal PR was #2270
Thanks to @nfm
|
| | | |
| | | |
| | | |
| | | | |
Missed that too, thanks again @splattael.
|
| | | |
| | | |
| | | |
| | | | |
Thanks @splattael.
|
| | | |
| | | |
| | | |
| | | | |
Add some tests for link_to with blocks and escaping content.
|
| | | | |
|