Sha256: cd02ac26e9989e5606d994cc03b4a4b774d28d84535f40b2963d72a3143213cd

Contents?: true

Size: 465 Bytes

Versions: 16

Compression:

Stored size: 465 Bytes

Contents

module Gaku
  class UserCreator

    def initialize(params = {})
      @user = User.new(params)
      set_default_language
    end

    def save
      @user.save
    end

    def save!
      @user.save!
    end

    def get_user
      @user
    end

    private

    def set_default_language
      if Preset.active.nil?
        @user.settings[:locale] = 'en'
      else
        @user.settings[:locale] = Preset.active.locale['language']
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
gaku_core-0.3.0 app/services/gaku/user_creator.rb
gaku_core-0.3.0.pre.4 app/services/gaku/user_creator.rb
gaku_core-0.3.0.pre.3 app/services/gaku/user_creator.rb
gaku_core-0.3.0.pre.2 app/services/gaku/user_creator.rb
gaku_core-0.3.0.pre.1 app/services/gaku/user_creator.rb
gaku_core-0.3.0.pre.0 app/services/gaku/user_creator.rb
gaku-0.2.4 core/app/services/gaku/user_creator.rb
gaku_core-0.2.4 app/services/gaku/user_creator.rb
gaku-0.2.3 core/app/services/gaku/user_creator.rb
gaku_core-0.2.3 app/services/gaku/user_creator.rb
gaku-0.2.2 core/app/services/gaku/user_creator.rb
gaku_core-0.2.2 app/services/gaku/user_creator.rb
gaku-0.2.1 core/app/services/gaku/user_creator.rb
gaku_core-0.2.1 app/services/gaku/user_creator.rb
gaku-0.2.0 core/app/services/gaku/user_creator.rb
gaku_core-0.2.0 app/services/gaku/user_creator.rb