rabl 0.13.1 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +4 -2
- data/CHANGELOG.md +4 -0
- data/README.md +16 -10
- data/Rakefile +12 -3
- data/fixtures/ashared/NOTES +46 -0
- data/fixtures/ashared/controllers_rails_5/posts_controller.rb +17 -0
- data/fixtures/ashared/controllers_rails_5/users_controller.rb +11 -0
- data/fixtures/{rails5/app → ashared}/helpers/application_helper.rb +0 -0
- data/fixtures/rails3/db/schema.rb +42 -0
- data/fixtures/rails4/Gemfile +5 -1
- data/fixtures/rails4/config/environments/test.rb +3 -0
- data/fixtures/rails4/db/schema.rb +42 -0
- data/fixtures/rails5/Gemfile +1 -0
- data/fixtures/rails5/Rakefile +1 -1
- data/fixtures/rails5/app/controllers/posts_controller.rb +1 -0
- data/fixtures/rails5/app/controllers/users_controller.rb +1 -0
- data/fixtures/rails5/app/helpers +1 -0
- data/fixtures/rails5/config/initializers/mime_types.rb +2 -0
- data/fixtures/rails5/test/functional/posts_controller_test.rb +1 -0
- data/fixtures/rails5/test/functional/users_controller_test.rb +1 -0
- data/fixtures/rails5_api/.gitignore +21 -0
- data/fixtures/rails5_api/Gemfile +46 -0
- data/fixtures/rails5_api/README.md +24 -0
- data/fixtures/rails5_api/Rakefile +13 -0
- data/fixtures/rails5_api/app/channels/application_cable/channel.rb +4 -0
- data/fixtures/rails5_api/app/channels/application_cable/connection.rb +4 -0
- data/fixtures/rails5_api/app/controllers/application_controller.rb +2 -0
- data/fixtures/rails5_api/app/controllers/concerns/.keep +0 -0
- data/fixtures/rails5_api/app/controllers/posts_controller.rb +1 -0
- data/fixtures/rails5_api/app/controllers/users_controller.rb +1 -0
- data/fixtures/rails5_api/app/helpers +1 -0
- data/fixtures/rails5_api/app/jobs/application_job.rb +2 -0
- data/fixtures/rails5_api/app/mailers/application_mailer.rb +4 -0
- data/fixtures/rails5_api/app/models +1 -0
- data/fixtures/rails5_api/app/views +1 -0
- data/fixtures/rails5_api/bin/bundle +3 -0
- data/fixtures/rails5_api/bin/rails +9 -0
- data/fixtures/rails5_api/bin/rake +9 -0
- data/fixtures/rails5_api/bin/setup +34 -0
- data/fixtures/rails5_api/bin/spring +17 -0
- data/fixtures/rails5_api/bin/update +29 -0
- data/fixtures/rails5_api/config.ru +5 -0
- data/fixtures/rails5_api/config/application.rb +30 -0
- data/fixtures/rails5_api/config/boot.rb +3 -0
- data/fixtures/rails5_api/config/cable.yml +9 -0
- data/fixtures/rails5_api/config/database.yml +25 -0
- data/fixtures/rails5_api/config/environment.rb +5 -0
- data/fixtures/rails5_api/config/environments/development.rb +47 -0
- data/fixtures/rails5_api/config/environments/production.rb +78 -0
- data/fixtures/rails5_api/config/environments/test.rb +42 -0
- data/fixtures/rails5_api/config/initializers/application_controller_renderer.rb +6 -0
- data/fixtures/rails5_api/config/initializers/backtrace_silencers.rb +7 -0
- data/fixtures/rails5_api/config/initializers/cors.rb +16 -0
- data/fixtures/rails5_api/config/initializers/filter_parameter_logging.rb +4 -0
- data/fixtures/rails5_api/config/initializers/inflections.rb +16 -0
- data/fixtures/rails5_api/config/initializers/mime_types.rb +5 -0
- data/fixtures/rails5_api/config/initializers/new_framework_defaults.rb +18 -0
- data/fixtures/rails5_api/config/initializers/wrap_parameters.rb +14 -0
- data/fixtures/rails5_api/config/locales/en.yml +23 -0
- data/fixtures/rails5_api/config/puma.rb +47 -0
- data/fixtures/rails5_api/config/routes.rb +8 -0
- data/fixtures/rails5_api/config/secrets.yml +22 -0
- data/fixtures/rails5_api/config/spring.rb +6 -0
- data/fixtures/rails5_api/db/migrate +1 -0
- data/fixtures/rails5_api/db/schema.rb +41 -0
- data/fixtures/rails5_api/db/seeds.rb +7 -0
- data/fixtures/rails5_api/lib/tasks/.keep +0 -0
- data/fixtures/rails5_api/log/.keep +0 -0
- data/fixtures/rails5_api/public/robots.txt +5 -0
- data/fixtures/rails5_api/test/controllers/.keep +0 -0
- data/fixtures/rails5_api/test/fixtures/.keep +0 -0
- data/fixtures/rails5_api/test/fixtures/files/.keep +0 -0
- data/fixtures/rails5_api/test/functional/posts_controller_test.rb +1 -0
- data/fixtures/rails5_api/test/functional/users_controller_test.rb +1 -0
- data/fixtures/rails5_api/test/integration/.keep +0 -0
- data/fixtures/rails5_api/test/mailers/.keep +0 -0
- data/fixtures/rails5_api/test/models/.keep +0 -0
- data/fixtures/rails5_api/test/test_helper.rb +39 -0
- data/fixtures/rails5_api/tmp/.keep +0 -0
- data/lib/rabl.rb +1 -1
- data/lib/rabl/builder.rb +13 -3
- data/lib/rabl/configuration.rb +2 -0
- data/lib/rabl/engine.rb +2 -0
- data/lib/rabl/railtie.rb +17 -0
- data/lib/rabl/version.rb +1 -1
- data/rabl.gemspec +1 -1
- data/test/builder_test.rb +26 -0
- data/test/engine_test.rb +6 -0
- data/test/integration/rails5/posts_controller_test.rb +251 -0
- data/test/integration/rails5/users_controller_test.rb +87 -0
- data/test/models/user.rb +10 -9
- metadata +74 -6
- data/fixtures/rails5/app/controllers/posts_controller.rb +0 -17
- data/fixtures/rails5/app/controllers/users_controller.rb +0 -11
@@ -1,17 +0,0 @@
|
|
1
|
-
class PostsController < ApplicationController
|
2
|
-
|
3
|
-
respond_to :json, :xml, :html, :rabl_test_v1
|
4
|
-
|
5
|
-
def index
|
6
|
-
@posts = Post.order('id ASC').load
|
7
|
-
end
|
8
|
-
|
9
|
-
def show
|
10
|
-
@post = Post.find(params[:id])
|
11
|
-
end
|
12
|
-
|
13
|
-
def renderer
|
14
|
-
post = Post.find(params[:id])
|
15
|
-
render json: Rabl.render(post, 'posts/renderer', view_path: 'app/views', format: :json, scope: view_context)
|
16
|
-
end
|
17
|
-
end
|