Sha256: 352145f9bf05f3811cac767a2c741a2e77ac27a8166b702ffbb2673f5cf33715

Contents?: true

Size: 675 Bytes

Versions: 3

Compression:

Stored size: 675 Bytes

Contents

module Typus
  module Orm
    module ActiveRecord
      module User
        module ClassMethods

          def generate(*args)
            options = args.extract_options!
            options[:password] ||= Typus.password
            options[:role] ||= Typus.master_role
            user = new :email => options[:email], :password => options[:password]
            user.status = true
            user.role = options[:role]
            user.save ? user : false
          end

          def role
            Typus::Configuration.roles.keys.sort
          end

          def locale
            Typus::I18n.available_locales
          end

        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
typus-3.1.0.rc14 lib/typus/orm/active_record/user/class_methods.rb
typus-3.1.0.rc13 lib/typus/orm/active_record/user/class_methods.rb
typus-3.1.0.rc12 lib/typus/orm/active_record/user/class_methods.rb