Class: Landable::RegistrationService

Inherits:
Object
  • Object
show all
Defined in:
app/services/landable/registration_service.rb

Class Method Summary collapse

Class Method Details

.call(attributes) ⇒ Object



5
6
7
8
9
10
11
12
# File 'app/services/landable/registration_service.rb', line 5

def self.call(attributes)
  author = Author.where(username: attributes[:username]).first
  if author
    author
  else
    Author.create!(attributes.slice(:username, :email, :first_name, :last_name))
  end
end