Added extra params to Clients API:
This commit is contained in:
parent
349ccd3af9
commit
a1b087a584
|
@ -6,12 +6,12 @@ module Api
|
||||||
def create
|
def create
|
||||||
respond_with Client.create(client_params)
|
respond_with Client.create(client_params)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# Never trust parameters from the scary internet, only allow the white list through.
|
# Never trust parameters from the scary internet, only allow the white list through.
|
||||||
def client_params
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,12 @@ class Client
|
||||||
field :site_name, type: String
|
field :site_name, type: String
|
||||||
field :site_token, type: String
|
field :site_token, type: String
|
||||||
field :site_id, 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_id, :uniqueness => true
|
||||||
validates :site_token, :uniqueness => true
|
validates :site_token, :uniqueness => true
|
||||||
end
|
end
|
|
@ -12,7 +12,8 @@ Mtstore::Application.configure do
|
||||||
# Show full error reports and disable caching.
|
# Show full error reports and disable caching.
|
||||||
config.consider_all_requests_local = true
|
config.consider_all_requests_local = true
|
||||||
config.action_controller.perform_caching = false
|
config.action_controller.perform_caching = false
|
||||||
|
|
||||||
|
config.action_mailer.perform_deliveries = true
|
||||||
# Don't care if the mailer can't send.
|
# Don't care if the mailer can't send.
|
||||||
config.action_mailer.raise_delivery_errors = false
|
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
|
# This option may cause significant delays in view rendering with a large
|
||||||
# number of complex assets.
|
# number of complex assets.
|
||||||
config.assets.debug = true
|
config.assets.debug = true
|
||||||
|
config.action_mailer.delivery_method = :smtp
|
||||||
|
config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 }
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue