Sha256: 9a5f9add165c814d3ede8ffe7bb1b3ff0f6a36028d74406e3ee9d90602c5bca2
Contents?: true
Size: 796 Bytes
Versions: 18
Compression:
Stored size: 796 Bytes
Contents
# config/initializers/koala.rb # Monkey-patch in Facebook config so Koala knows to # automatically use Facebook settings from here if none are given module Facebook CONFIG = YAML.load(ERB.new(File.read("#{RAILS_ROOT}/config/facebook.yml")).result)[RAILS_ENV] APP_ID = CONFIG['app_id'] SECRET = CONFIG['secret_key'] end Koala::Facebook::OAuth.class_eval do def initialize_with_default_settings(*args) case args.size when 0, 1 raise "application id and/or secret are not specified in the config" unless Facebook::APP_ID && Facebook::SECRET initialize_without_default_settings(Facebook::APP_ID.to_s, Facebook::SECRET.to_s, args.first) when 2, 3 initialize_without_default_settings(*args) end end alias_method_chain :initialize, :default_settings end
Version data entries
18 entries across 18 versions & 1 rubygems