Top Level Namespace

Includes:
EnjuLibrary::EnjuItem

Defined Under Namespace

Modules: EnjuLeaf, LocalizedName, PageHelper Classes: ApplicationMailer, NamesController, Notifier, PageController, String, UrlValidator, UserExportFileJob, UserImportFileJob

Instance Method Summary collapse

Instance Method Details

#new_profileObject

unless solr = Sunspot.commit rescue nil

raise "Solr is not running."

end


26
27
28
29
30
31
32
33
# File 'lib/generators/enju_leaf/setup/templates/db/seeds.rb', line 26

def new_profile
  profile = Profile.new
  profile.user_group = UserGroup.first
  profile.library = Library.real.first
  profile.locale = I18n.default_locale.to_s
  profile.full_name = 'System'
  profile
end

#update_profileObject


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/tasks/profile.rb', line 1

def update_profile
  User.find_each do |user|
    next if user.profile
    profile = Profile.new
    profile.user = user
    profile.user_group = user.user_group
    profile.library = user.library
    profile.required_role = user.required_role
    profile.user_number = user.user_number
    profile.keyword_list = user.keyword_list
    profile.locale = user.locale
    profile.note = user.note
    profile.save!
  end
end