mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 06:34:46 +02:00
Refactor common part of the find_or_create_by_x into a private method
This commit is contained in:
parent
75119aff2e
commit
f92ece5467
3 changed files with 53 additions and 29 deletions
|
@ -26,9 +26,12 @@ module Api
|
|||
private
|
||||
|
||||
def eid_params
|
||||
[:ident, :first_name, :last_name].each_with_object(params) do |key, obj|
|
||||
required_params = [:ident, :first_name, :last_name]
|
||||
required_params.each_with_object(params) do |key, obj|
|
||||
obj.require(key)
|
||||
end
|
||||
|
||||
params.permit(required_params)
|
||||
end
|
||||
|
||||
def create_token(user)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue