module Workarea decorate User, with: :magento_user do decorated do include MagentoCustomer end class_methods do def create_from_magento_customer(customer) user = User.new(email: customer[:email] ,first_name: customer[:first_name] ,last_name: customer[:last_name]) user.entity_id = customer[:entity_id] user.date_of_birth = customer[:date_of_birth] user.save(validate: false) user end end end end