Sha256: b9b7426f895a2f3187ca42c17c4d5e5bc39525abae394df268584f3f27a24764

Contents?: true

Size: 1.43 KB

Versions: 3

Compression:

Stored size: 1.43 KB

Contents

MagicAddresses.configure do |config|
  # Address Owners .. all models that use addresses (name + class_name => {users: "User", things: "Namespace::Thing"}) 
  config.address_owners     = {}
  # in which locales addresses should be saved
  config.active_locales     = [:en, :de]
  # what is the default language (should be :en, except you don't need english at all)
  config.default_locale     = :en
  # what is the default country for query
  config.default_country    = "Germany"
  # add default country in each query ?
  config.query_defaults     = true
  # only save tranlations when differs from default-locale?
  config.uniq_translations  = false
  # use background-process for the lookups ( :none | :sidekiq )
  config.job_backend        = :none
  # use postgres earthdistance for distance calculation
  config.earthdistance      = false
  # show state in tables ( true | false )
  config.show_states        = false
  # show triggers in tables ( true | false ) **not available for now!!!
  config.show_triggers      = false

end

##
## Need authentication for admin routes use this:
##
# => MagicAddresses::BaseController.class_eval do 
# =>   private
# =>     # overwrite authentication method
# =>     def authenticate_visitor
# =>       unless current_user && current_user.is_admin?
# =>         session["user_return_to"] = request.fullpath
# =>         redirect_to new_user_session_path, alert: "Only for admins, dude!"
# =>       end
# =>     end
# => end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
magic_addresses-0.0.35 lib/generators/magic_addresses/templates/magic_initializer.rb
magic_addresses-0.0.34 lib/generators/magic_addresses/templates/magic_initializer.rb
magic_addresses-0.0.33 lib/generators/magic_addresses/templates/magic_initializer.rb