cadenero 0.0.2.b3 → 0.0.2.b4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/README.md +12 -9
- data/app/controllers/cadenero/v1/account/sessions_controller.rb +1 -1
- data/app/controllers/cadenero/v1/account/users_controller.rb +8 -9
- data/app/controllers/cadenero/v1/accounts_controller.rb +2 -9
- data/app/extenders/controllers/application_controller_decorator.rb +1 -1
- data/app/extenders/middleware/robustness.rb +0 -2
- data/app/models/cadenero/user.rb +2 -1
- data/app/models/cadenero/v1/account.rb +2 -0
- data/config/routes.rb +3 -2
- data/lib/cadenero/testing_support/authentication_helpers.rb +93 -0
- data/lib/cadenero/version.rb +1 -1
- data/spec/dummy/config/application.rb +8 -7
- data/spec/dummy/config/boot.rb +7 -3
- data/spec/dummy/config/environments/development.rb +9 -2
- data/spec/dummy/config/environments/production.rb +1 -2
- data/spec/dummy/config/environments/test.rb +7 -2
- data/spec/dummy/config/initializers/secret_token.rb +13 -2
- data/spec/dummy/config/initializers/wrap_parameters.rb +13 -0
- data/spec/dummy/log/development.log +5 -0
- data/spec/dummy/log/test.log +16262 -0
- data/spec/features/accounts/sign_up_spec.rb +10 -23
- data/spec/features/users/sign_in_spec.rb +16 -50
- data/spec/features/users/sign_up_spec.rb +22 -17
- data/spec/support/factories/user_factory.rb +0 -1
- metadata +18 -39
- data/config/initializers/strong_parameters.rb +0 -1
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/inflections.rb +0 -15
- data/spec/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/dummy/config/initializers/session_store.rb +0 -8
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YWFkM2QwNGFkNGJjNGVlOGM0ZmVkNDIzZDI2NTdlM2IwYTgxZjMxMQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzIyNDk3ZDdiMjE3ZWVmOTBmOWY0MTUxYTRhMDU1ZjEyYzE2MzViNg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODUwOGQ0OGFlNmYwZjc1MzE4YjAxZTMwZGZhZDJlZTVkZmY3NmIxZGYxMWFm
|
10
|
+
OGFjYzkwYzI2ZTYyMzlkZjdkM2JjOGI4Y2I1Njg2ZDVkY2NkMDgyNTVhNTY1
|
11
|
+
ZmZiYTcyMWU1MTE4NGQ0MWUzMWVhYTg5YTc0MzdiODVmYjlkODI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjU0OWZjYTBhMWIxZjc5NmRjNDgwOTQ4MzU2M2ZjNWY3ZTM4NDk0Zjc4Yzlk
|
14
|
+
MWQ4MjllZWM0OTA3M2U3MmRlZDYwNDlkNTA2ZWY5NGJkNmQ3YmVjMzJkMjNl
|
15
|
+
YTRmNjI1MWRiNGYwZTM1NDRhMjdiNDBiYzA2NTI1NjhmZWUwMzg=
|
data/README.md
CHANGED
@@ -20,15 +20,17 @@ Authentication Engine for Rails.API multitenant RESTful APIs based on Warden. It
|
|
20
20
|
|
21
21
|
### Installing **Cadenero**
|
22
22
|
|
23
|
-
|
23
|
+
Rails 3.2.13 is the master version used now by **Cadenero**, if you want to use Rails 4 goodness please use the branch "rails4"
|
24
|
+
|
25
|
+
Generate first your Rails app as usual using:
|
24
26
|
|
25
27
|
```
|
26
|
-
$ rails
|
28
|
+
$ rails _3.2.13_ new your_app --skip-test-unit
|
27
29
|
```
|
28
30
|
|
29
31
|
In the `Gemfile` add the following lines:
|
30
32
|
```ruby
|
31
|
-
gem 'cadenero',
|
33
|
+
gem 'cadenero', '~> 0.0.2.b4'
|
32
34
|
gem 'pg'
|
33
35
|
```
|
34
36
|
|
@@ -97,12 +99,13 @@ Have fun!
|
|
97
99
|
**Cadenero** creates the following versioned routes for exposing the authentication RESTful API
|
98
100
|
|
99
101
|
```
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
102
|
+
v1_root /v1(.:format) cadenero/v1/account/dashboard#index {:default=>:json}
|
103
|
+
v1_sessions POST /v1/sessions(.:format) cadenero/v1/account/sessions#create {:default=>:json}
|
104
|
+
DELETE /v1/sessions(.:format) cadenero/v1/account/sessions#delete {:default=>:json}
|
105
|
+
v1_users POST /v1/users(.:format) cadenero/v1/account/users#create {:default=>:json}
|
106
|
+
v1 GET /v1/users/:id(.:format) cadenero/v1/account/users#show {:default=>:json}
|
107
|
+
v1_accounts POST /v1/accounts(.:format) cadenero/v1/accounts#create {:default=>:json}
|
108
|
+
root / cadenero/v1/account/dashboard#index {:default=>:json}
|
106
109
|
```
|
107
110
|
|
108
111
|
You can check them running:
|
@@ -7,7 +7,7 @@ module Cadenero::V1
|
|
7
7
|
def create
|
8
8
|
if env['warden'].authenticate(:password, :scope => :user)
|
9
9
|
#return the user JSON on success
|
10
|
-
render json: current_user,
|
10
|
+
render json: current_user, status: :created
|
11
11
|
else
|
12
12
|
#return error mesage in a JSON on error
|
13
13
|
render json: {errors: {user:["Invalid email or password"]}}, status: :unprocessable_entity
|
@@ -19,23 +19,22 @@ module Cadenero
|
|
19
19
|
# fulfilled and resulted in a new resource being created.
|
20
20
|
def create
|
21
21
|
account = Cadenero::V1::Account.where(subdomain: request.subdomain).first
|
22
|
-
@user = account.users.create(
|
22
|
+
@user = account.users.create(params[:user])
|
23
23
|
force_authentication!(@user)
|
24
|
-
render json: @user,
|
24
|
+
render json: @user, status: :created
|
25
25
|
end
|
26
|
+
|
26
27
|
# Send as JSON the user that match the params[:user]
|
27
28
|
def show
|
28
|
-
@user =
|
29
|
+
@user = current_account.users.where(id: params[:id]).first
|
29
30
|
render json: @user, status: :ok
|
30
31
|
end
|
31
32
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
params.require(:user).permit(:email, :password, :password_confirmation)
|
33
|
+
# Send as JSON the users for the current_account
|
34
|
+
def index
|
35
|
+
@users = current_account.users
|
36
|
+
render json: @users, status: :ok
|
37
37
|
end
|
38
|
-
|
39
38
|
end
|
40
39
|
end
|
41
40
|
end
|
@@ -20,12 +20,12 @@ module Cadenero
|
|
20
20
|
# @return render JSON of [Cadenero::V1::Account] created and the status 201 Created: The request has been
|
21
21
|
# fulfilled and resulted in a new resource being created.
|
22
22
|
def create
|
23
|
-
@account = Cadenero::V1::Account.create_with_owner(
|
23
|
+
@account = Cadenero::V1::Account.create_with_owner(params[:account])
|
24
24
|
if @account.valid?
|
25
25
|
@account.create_schema
|
26
26
|
@account.ensure_authentication_token!
|
27
27
|
force_authentication!(@account.owner)
|
28
|
-
render json: @account,
|
28
|
+
render json: @account, status: :created
|
29
29
|
else
|
30
30
|
@data = {
|
31
31
|
errors: @account.errors
|
@@ -33,13 +33,6 @@ module Cadenero
|
|
33
33
|
render json: @data, status: :unprocessable_entity
|
34
34
|
end
|
35
35
|
end
|
36
|
-
|
37
|
-
private
|
38
|
-
|
39
|
-
# Permited parameters using strong parameters format
|
40
|
-
def account_params
|
41
|
-
params.require(:account).permit(:name, :subdomain, owner_attributes: [:email, :password, :password_confirmation])
|
42
|
-
end
|
43
36
|
end
|
44
37
|
end
|
45
38
|
end
|
@@ -30,7 +30,7 @@
|
|
30
30
|
|
31
31
|
# Check to see if there is an authenticated user
|
32
32
|
def user_signed_in?
|
33
|
-
env['warden'].authenticated?(:user)
|
33
|
+
env['warden'].authenticated?(:user)
|
34
34
|
end
|
35
35
|
|
36
36
|
# it the user is not authenticated returns a 422 and an informative error with the link for sign
|
@@ -10,8 +10,6 @@ class Robustness
|
|
10
10
|
@app.call(env)
|
11
11
|
rescue Apartment::SchemaNotFound => ex
|
12
12
|
[422, { 'Content-Type' => 'application/json' }, [ {errors: {subdomain:["Invalid subdomain"]}}.to_json ] ] # suppose the message can be safely used
|
13
|
-
rescue ArgumentError => ex
|
14
|
-
[422, { 'Content-Type' => 'application/json' }, [ {errors: {subdomain:["Invalid subdomain"]}}.to_json ] ] # suppose the message can be safely used
|
15
13
|
rescue SecurityError => ex
|
16
14
|
[403, { 'Content-Type' => 'application/json' }, [ ex.message ] ]
|
17
15
|
ensure
|
data/app/models/cadenero/user.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module Cadenero
|
2
2
|
# Defines a user of one or more accounts for the multitenant Rails App
|
3
3
|
class User < ActiveRecord::Base
|
4
|
+
attr_accessible :email, :password, :password_confirmation
|
4
5
|
has_secure_password
|
5
6
|
has_many :accounts, class_name: "Cadenero::V1::Account", foreign_key: "owner_id"
|
6
7
|
has_many :members, class_name: "Cadenero::Member"
|
@@ -8,7 +9,7 @@ module Cadenero
|
|
8
9
|
|
9
10
|
# Obtain the authentication_token from the account to be use for the User
|
10
11
|
def auth_token
|
11
|
-
accounts
|
12
|
+
accounts.map{|acc| acc.authentication_token}
|
12
13
|
end
|
13
14
|
|
14
15
|
end
|
@@ -6,8 +6,10 @@ module Cadenero::V1
|
|
6
6
|
has_many :users, :through => :members, :class_name => "Cadenero::User"
|
7
7
|
|
8
8
|
accepts_nested_attributes_for :owner
|
9
|
+
attr_accessible :name, :subdomain, :owner_attributes, :owner
|
9
10
|
validates :subdomain, :presence => true, :uniqueness => true
|
10
11
|
validates :owner, :presence => true
|
12
|
+
after_create :ensure_authentication_token!
|
11
13
|
|
12
14
|
# Creates an account and assign the provided [Cadenero::User] as owner to the account
|
13
15
|
# @param [Hash] params list
|
data/config/routes.rb
CHANGED
@@ -8,10 +8,11 @@ Cadenero::Engine.routes.draw do
|
|
8
8
|
post '/sessions', :to => "sessions#create", default: :json
|
9
9
|
delete '/sessions', :to => "sessions#delete", default: :json
|
10
10
|
post '/users', :to => "users#create", default: :json
|
11
|
-
get '/users', :to => "users#
|
11
|
+
get '/users', :to => "users#index", default: :json
|
12
|
+
get '/users/:id', :to => "users#show", as: :user, default: :json
|
12
13
|
end
|
13
14
|
end
|
14
|
-
post '/accounts', :to => "accounts#create", :
|
15
|
+
post '/accounts', :to => "accounts#create", as: :accounts, default: :json
|
15
16
|
|
16
17
|
end
|
17
18
|
root :to => "v1/account/dashboard#index", default: :json
|
@@ -0,0 +1,93 @@
|
|
1
|
+
module Cadenero
|
2
|
+
# Helper Methods for testing
|
3
|
+
module TestingSupport
|
4
|
+
# RSpec Helper for subdomains
|
5
|
+
module AuthenticationHelpers
|
6
|
+
# creates a dummy user for testing
|
7
|
+
# @return a dummy user JSON parameters for sign up
|
8
|
+
def create_account_user
|
9
|
+
@user ||= { email: "user@example.com", password: "password", password_confirmation: "password" }
|
10
|
+
end
|
11
|
+
# @param user [Cadenero::User]
|
12
|
+
# @return [JSON] a dummy user JSON parameters for sign in
|
13
|
+
def account_user(user)
|
14
|
+
@user = { email: user.email, password: "password" }
|
15
|
+
end
|
16
|
+
|
17
|
+
# find an account in the Database using the email of the owner
|
18
|
+
# @return [Cadenero::V1::Account] the corresponding account that was founded
|
19
|
+
def find_account_by_email
|
20
|
+
@account = Cadenero::V1::Account.where(name: create_account_user[:email]).first
|
21
|
+
end
|
22
|
+
|
23
|
+
# find an account in the Database using the name of the owner
|
24
|
+
# @return [Cadenero::V1::Account] the corresponding account that was founded
|
25
|
+
def find_account_by_name
|
26
|
+
@account = Cadenero::V1::Account.where(name: @visitor[:name]).first
|
27
|
+
end
|
28
|
+
|
29
|
+
# sing in a user sending a POST
|
30
|
+
# @param url [String] the URL to be POSTed
|
31
|
+
# @param user [Cadenero::User] to be POSTed
|
32
|
+
# @return [Cadenero::V1::Account] the corresponding account that was founded
|
33
|
+
def sign_in_user(url, user)
|
34
|
+
post "#{url}", format: :json, user: user
|
35
|
+
find_account_by_email
|
36
|
+
end
|
37
|
+
|
38
|
+
# Expect that the JSON response from the server corresponds to the provided msg
|
39
|
+
# @param msg [JSON] the errors: as JSON
|
40
|
+
def expected_json_errors(msg)
|
41
|
+
expect(last_response.body).to eql(msg)
|
42
|
+
expect(last_response.status).to eq 422
|
43
|
+
end
|
44
|
+
|
45
|
+
# Expect that the JSON response will be a default error message when the user has not signed in yet
|
46
|
+
# the errors_redirect_ro_sign_in is defined if was not previously defined is a Spec
|
47
|
+
def check_error_for_not_signed_in_yet
|
48
|
+
errors_redirect_ro_sign_in ||= {errors: %Q{Please sign in. posting the user json credentials as: {"user": {"email": "testy2@example.com", "password": "changeme"}} to /v1/sessions}, links: "/v1/sessions"}.to_json
|
49
|
+
get cadenero.v1_root_url(:subdomain => account.subdomain)
|
50
|
+
expected_json_errors(errors_redirect_ro_sign_in)
|
51
|
+
end
|
52
|
+
|
53
|
+
# Sign up a dummy user for testing
|
54
|
+
# @return [Cadenero::V1::Account] the corresponding account that was founded
|
55
|
+
def sign_up_user(url)
|
56
|
+
post "#{url}/v1/users", format: :json, user: create_account_user
|
57
|
+
find_account_by_email
|
58
|
+
end
|
59
|
+
|
60
|
+
# Expect that a owner sign in successfuly to an account
|
61
|
+
# @param account [Cadenero::V1::Account]
|
62
|
+
# @return email [String] for the last response user
|
63
|
+
def successful_sign_in_owner(account)
|
64
|
+
sign_in_user sessions_url, account_user(account.owner)
|
65
|
+
expect(last_response.status).to eq 201
|
66
|
+
expect(json_last_response_body["user"]["account_ids"]).to eq [account.id]
|
67
|
+
expect(json_last_response_body).to have_content "auth_token"
|
68
|
+
expect(json_last_response_body["user"]["auth_token"]).to eq [account.authentication_token]
|
69
|
+
return json_last_response_body["user"]["email"]
|
70
|
+
end
|
71
|
+
|
72
|
+
# creates a dummy account for testing
|
73
|
+
# @return [JSON] a dummy account JSON parameters
|
74
|
+
def create_account
|
75
|
+
@visitor ||= { name: "Testy", subdomain: "test", owner_attributes:
|
76
|
+
{email: "testy@example.com", password: "changeme", password_confirmation: "changeme"} }
|
77
|
+
end
|
78
|
+
|
79
|
+
# Sign up a dummy account for testing
|
80
|
+
# @return [Cadenero::V1::Account] the corresponding account that was founded
|
81
|
+
def sign_up_account
|
82
|
+
post "/v1/accounts", format: :json, account: create_account
|
83
|
+
find_account_by_name
|
84
|
+
end
|
85
|
+
|
86
|
+
# Parse the last_response.body as JSON
|
87
|
+
# @return [JSON] for the last_response.body
|
88
|
+
def json_last_response_body
|
89
|
+
JSON.parse(last_response.body)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
data/lib/cadenero/version.rb
CHANGED
@@ -2,12 +2,8 @@ require File.expand_path('../boot', __FILE__)
|
|
2
2
|
|
3
3
|
require 'rails/all'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
Bundler.require(*Rails.groups(:assets => %w(development test)))
|
8
|
-
# If you want your assets lazily compiled in production, use this line
|
9
|
-
# Bundler.require(:default, :assets, Rails.env)
|
10
|
-
end
|
5
|
+
Bundler.require(*Rails.groups)
|
6
|
+
require "cadenero"
|
11
7
|
|
12
8
|
module Dummy
|
13
9
|
class Application < Rails::Application
|
@@ -51,12 +47,17 @@ module Dummy
|
|
51
47
|
# This will create an empty whitelist of attributes available for mass-assignment for all models
|
52
48
|
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
|
53
49
|
# parameters by using an attr_accessible or attr_protected declaration.
|
54
|
-
|
50
|
+
config.active_record.whitelist_attributes = true
|
55
51
|
|
56
52
|
# Enable the asset pipeline
|
57
53
|
config.assets.enabled = true
|
58
54
|
|
59
55
|
# Version of your assets, change this if you want to expire all your assets
|
60
56
|
config.assets.version = '1.0'
|
57
|
+
|
58
|
+
config.generators do |g|
|
59
|
+
g.test_framework :rspec
|
60
|
+
end
|
61
61
|
end
|
62
62
|
end
|
63
|
+
|
data/spec/dummy/config/boot.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
require 'rubygems'
|
2
|
+
gemfile = File.expand_path('../../../../Gemfile', __FILE__)
|
2
3
|
|
3
|
-
|
4
|
-
ENV['BUNDLE_GEMFILE']
|
4
|
+
if File.exist?(gemfile)
|
5
|
+
ENV['BUNDLE_GEMFILE'] = gemfile
|
6
|
+
require 'bundler'
|
7
|
+
Bundler.setup
|
8
|
+
end
|
5
9
|
|
6
|
-
|
10
|
+
$:.unshift File.expand_path('../../../../lib', __FILE__)
|
@@ -4,9 +4,13 @@ Dummy::Application.configure do
|
|
4
4
|
# In the development environment your application's code is reloaded on
|
5
5
|
# every request. This slows down response time but is perfect for development
|
6
6
|
# since you don't have to restart the web server when you make code changes.
|
7
|
-
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
config.ember.variant = :development
|
10
|
+
|
11
|
+
# Log error messages when you accidentally call methods on nil.
|
12
|
+
config.whiny_nils = true
|
8
13
|
|
9
|
-
config.eager_load = false
|
10
14
|
# Show full error reports and disable caching
|
11
15
|
config.consider_all_requests_local = true
|
12
16
|
config.action_controller.perform_caching = false
|
@@ -20,6 +24,9 @@ Dummy::Application.configure do
|
|
20
24
|
# Only use best-standards-support built into browsers
|
21
25
|
config.action_dispatch.best_standards_support = :builtin
|
22
26
|
|
27
|
+
# Raise exception on mass assignment protection for Active Record models
|
28
|
+
config.active_record.mass_assignment_sanitizer = :strict
|
29
|
+
|
23
30
|
# Log the query plan for queries taking more than this (works
|
24
31
|
# with SQLite, MySQL, and PostgreSQL)
|
25
32
|
config.active_record.auto_explain_threshold_in_seconds = 0.5
|
@@ -4,8 +4,7 @@ Dummy::Application.configure do
|
|
4
4
|
# Code is not reloaded between requests
|
5
5
|
config.cache_classes = true
|
6
6
|
|
7
|
-
config.
|
8
|
-
#config.ember.variant = :production
|
7
|
+
config.ember.variant = :production
|
9
8
|
|
10
9
|
# Full error reports are disabled and caching is turned on
|
11
10
|
config.consider_all_requests_local = false
|
@@ -7,13 +7,15 @@ Dummy::Application.configure do
|
|
7
7
|
# and recreated between test runs. Don't rely on the data there!
|
8
8
|
config.cache_classes = true
|
9
9
|
|
10
|
-
config.
|
11
|
-
#config.ember.variant = :development
|
10
|
+
config.ember.variant = :development
|
12
11
|
|
13
12
|
# Configure static asset server for tests with Cache-Control for performance
|
14
13
|
config.serve_static_assets = true
|
15
14
|
config.static_cache_control = "public, max-age=3600"
|
16
15
|
|
16
|
+
# Log error messages when you accidentally call methods on nil
|
17
|
+
config.whiny_nils = true
|
18
|
+
|
17
19
|
# Show full error reports and disable caching
|
18
20
|
config.consider_all_requests_local = true
|
19
21
|
config.action_controller.perform_caching = false
|
@@ -29,6 +31,9 @@ Dummy::Application.configure do
|
|
29
31
|
# ActionMailer::Base.deliveries array.
|
30
32
|
# config.action_mailer.delivery_method = :test
|
31
33
|
|
34
|
+
# Raise exception on mass assignment protection for Active Record models
|
35
|
+
config.active_record.mass_assignment_sanitizer = :strict
|
36
|
+
|
32
37
|
# Print deprecation notices to the stderr
|
33
38
|
config.active_support.deprecation = :stderr
|
34
39
|
end
|
@@ -2,7 +2,18 @@
|
|
2
2
|
|
3
3
|
# Your secret key for verifying the integrity of signed cookies.
|
4
4
|
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
|
5
6
|
# Make sure the secret is at least 30 characters and all random,
|
6
7
|
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
-
|
8
|
-
|
8
|
+
# You can use `rake secret` to generate a secure secret key.
|
9
|
+
|
10
|
+
# Make sure your secret_key_base is kept private
|
11
|
+
# if you're sharing your code publicly.
|
12
|
+
|
13
|
+
# Although this is not needed for an api-only application, rails4
|
14
|
+
# requires secret_key_base or secret_toke to be defined, otherwise an
|
15
|
+
# error is raised.
|
16
|
+
# Using secret_token for rails3 compatibility. Change to secret_key_base
|
17
|
+
# to avoid deprecation warning.
|
18
|
+
# Can be safely removed in a rails3 api-only application.
|
19
|
+
Dummy::Application.config.secret_token = 'df98291699a229624c0907ad6236b289bc51369d1d1f2729b2c66cdad46b60cb2cb64b93d47b0d2fd9aa4f833bc8d4c98eaaed223f9d4b9ed684677f655611e8'
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
#
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper
|
4
|
+
|
5
|
+
# Enable parameter wrapping for JSON.
|
6
|
+
# ActiveSupport.on_load(:action_controller) do
|
7
|
+
# wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
8
|
+
# end
|
9
|
+
|
10
|
+
# To enable root element in JSON for ActiveRecord objects.
|
11
|
+
# ActiveSupport.on_load(:active_record) do
|
12
|
+
# self.include_root_in_json = true
|
13
|
+
# end
|
@@ -357,3 +357,8 @@ Apartment::SchemaNotFound (One of the following schema(s) is invalid: ):
|
|
357
357
|
Rendered /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (16.8ms)
|
358
358
|
Rendered /Users/manuelevidaurrea/Documents/work/agiltec/workspace/ruby/rails/cadenero/vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (46.0ms)
|
359
359
|
Connecting to database specified by database.yml
|
360
|
+
Connecting to database specified by database.yml
|
361
|
+
Connecting to database specified by database.yml
|
362
|
+
Connecting to database specified by database.yml
|
363
|
+
Connecting to database specified by database.yml
|
364
|
+
Connecting to database specified by database.yml
|