Class: Settings

Inherits:
Settingslogic
  • Object
show all
Includes:
Atreides::Extendable
Defined in:
app/models/settings.rb

Overview

Provides access to configuration options stored in config/settings.yml

Instance Method Summary collapse

Instance Method Details

#default_cross_post_to?(service) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
15
16
# File 'app/models/settings.rb', line 12

def default_cross_post_to? service
  setting = Settings.default_cross_posts && Settings.default_cross_posts[service] # by default, if nothing specified in Settings.yml
  return true if setting.nil?
  setting
end

#s3_enabled?Boolean

Check if we can use an Amazon S3 bucket to store photos

Returns:

  • (Boolean)

    true if the S3 gem and configuration is present, false otherwise



8
9
10
# File 'app/models/settings.rb', line 8

def s3_enabled?
  !!(s3.access_key_id.present? && s3.secret_access_key.present? if respond_to? :s3)
end