8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/generators/data_mapper/devise_install_generator.rb', line 8
def inject_data_mapper_content
devise_init_file = File.join(::Rails.root, 'config', 'initializers', 'devise.rb')
validations = " # ==> Validations Library\n # dm-devise adds some compatibility methods for either dm-validations or\n # Active Model validations. By default, it determines what to load based on\n # which library is found (giving preference to dm-validations). You may\n # explicitly set this to 'dm-validations' or 'active_model', or false to not\n # load any of the validations compatibility code.\n # config.data_mapper_validation_lib = nil\n\n"
inject_into_file devise_init_file, validations, :before => ' # ==> ORM configuration'
data_mapper_options = "\n # ==> dm-validations Default Error Messages\n # Messages to use as the default DataMapper validation error messages. The\n # messages are updated from those included in dm-validations to be consistent\n # with ActiveModel (i.e. with the Devise test expectations) and include\n # additional messages that devise uses (:not_found, :already_confirmed,\n # :not_locked, and :expired). If set to false, the messages are left as\n # defined by the dm-validations gem. See dm-devise.rb for default.\n # config.data_mapper_validation_messages = {}\n"
inject_into_file devise_init_file, data_mapper_options, :after => "orm/data_mapper'\n"
end
|