| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ \
| | |
| | | |
change AMS::JSON.include_root_in_json default value to false
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
|
| | |
| | |
| | |
| | | |
Module#methods are Symbols in Ruby >= 1.9
|
| | | |
|
| | |
| | |
| | |
| | | |
app generator
|
|\ \ \
| | | |
| | | | |
bundle exec rake assets:precompile shouldn't fail quietly.
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If JavaScript runtime is not installed, execjs fails with error quietly,
while tests continue to run. This should not happen since it causes tests
to fail for unknown reason (#6621).
This commit assures that if JavaScript runtime is not installed, an assertion
is raised.
|
|/ / |
|
| | |
|
| |
| |
| |
| |
| |
| | |
This reverts commit 82c3aca17e78d25f217702e530586673f2a219d7.
Reason: Ruby 1.9.3 is shipped with Rake > 0.9
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
CoffeeScript files to `rake stats` task
Orignal PR was #2270
Thanks to @nfm
|
| |
| |
| |
| | |
This will fix the travis-ci build
|
| |
| |
| |
| | |
f4d7af67ffc90f2542afa50c7579fc83ea4f45f2
|
| |
| |
| |
| |
| |
| | |
'therubyracer'.
Dependency.rb expects the symbol to be named :platforms as opposed to platform. RubyMine's inspections indicate that the symbol should be named :platforms.
|
| | |
|
|/
|
|
| |
Allow hyphens in environment names again.
|
|
|
| |
Since the environment is initialized each time rake is run, routes don't need to be re-loaded. https://github.com/rails/rails/pull/6461#r869953
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
railites_order method, introduced in 40b19e0, had a bug that was causing
loading application instance twice in initializers if railties_order
already included application instance. So for example
railties_order = [Foo::Engine, :main_app, Bar::Engine]
would result in such railties array:
[MyApp::Application, Foo::Engine, MyAppApplication, Bar::Engine]
In order to fix it, we need to check for existence of application in
both railties_order and railties arrays.
|
|
|
|
|
|
|
|
| |
This fixex build 4008.1[1] because of the changes made in
4001835db00ce44cb75bca33ec02cd76b8ccc790
[1] http://travis-ci.org/#!/rails/rails/jobs/1429671
|
|\
| |
| | |
Remove Unnecessary Test from route_inspect_test
|
| | |
|
| | |
|
|/ |
|
|
|
|
| |
This includes new tests for /rails/info/routes
|
|
|
|
| |
Will show similar contents to the output of `$ rake routes` in the browser in development. This speeds the time required to generate routes, since the application is already initialized.
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Many engines rely on being able to join directories to the Rails root:
Rails.root.join('somedir')
- This was now impossible because Rails.root returned a String:
NoMethodError: undefined method `join' for "/code/myrailsapp":String
- This was broken in 4001835db00ce44cb75bca33ec02cd76b8ccc790
|
| |
|
|
|
|
|
|
| |
Pathname"
This reverts commit d77b576c0330d8b1c6189cb94814382ce32baab6.
|
| |
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This reverts commit fa6d921e11363e9b8c4bc10f7aed0b9faffdc33a.
Reason: Not a fan of such massive changes. We usually close such changes
if made to Rails master as a pull request. Following the same principle
here and reverting.
[ci skip]
|
| |
| |
| |
| |
| | |
This comment about :env option for gem method was actual for rails 2.3
without bundler. Now bundler uses grups for this goal.
|
| |
| |
| |
| |
| |
| |
| | |
For future reference, this is the regex I used: ^\s*#\s*\n(?!\s*#). Replace
with the first match, and voilà! Note that the regex matches a little bit too
much, so you probably want to `git add -i .` and go through every single diff
to check if it actually should be changed.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|