From a1b087a5845b89d6537ee4f961e83ae901e26282 Mon Sep 17 00:00:00 2001 From: Saurabh Bhatia Date: Tue, 18 Feb 2014 17:06:53 +0800 Subject: [PATCH] Added extra params to Clients API: --- app/controllers/api/v1/clients_controller.rb | 4 ++-- app/models/client.rb | 7 ++++++- config/environments/development.rb | 5 ++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/v1/clients_controller.rb b/app/controllers/api/v1/clients_controller.rb index 9e003d8..a5e0c8b 100644 --- a/app/controllers/api/v1/clients_controller.rb +++ b/app/controllers/api/v1/clients_controller.rb @@ -6,12 +6,12 @@ module Api def create respond_with Client.create(client_params) end - + private # Never trust parameters from the scary internet, only allow the white list through. def client_params - params.require(:client).permit(:site_name, :site_token, :site_id) + params.require(:client).permit(:site_name, :site_token, :site_id, :university, :department, :email, :country, :url) end end end diff --git a/app/models/client.rb b/app/models/client.rb index f692a61..da08203 100644 --- a/app/models/client.rb +++ b/app/models/client.rb @@ -3,7 +3,12 @@ class Client field :site_name, type: String field :site_token, type: String field :site_id, type: String + field :university, type: String + field :department, type: String + field :email, type: String + field :country, type: String + field :url, type: String validates :site_id, :uniqueness => true validates :site_token, :uniqueness => true -end +end \ No newline at end of file diff --git a/config/environments/development.rb b/config/environments/development.rb index 5662a75..bf1a224 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -12,7 +12,8 @@ Mtstore::Application.configure do # Show full error reports and disable caching. config.consider_all_requests_local = true config.action_controller.perform_caching = false - + + config.action_mailer.perform_deliveries = true # Don't care if the mailer can't send. config.action_mailer.raise_delivery_errors = false @@ -24,4 +25,6 @@ Mtstore::Application.configure do # This option may cause significant delays in view rendering with a large # number of complex assets. config.assets.debug = true + config.action_mailer.delivery_method = :smtp + config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 } end