Skip to content

Instantly share code, notes, and snippets.

@lks128
lks128 / 01_paperclip.rb
Created December 25, 2012 15:30
Paperclip Rails initializer to store data on the European S3 server using Fog.
# config/initializers/01_paperclip.rb
if Rails.env.production?
Paperclip::Attachment.default_options.merge!(
storage: :fog,
fog_directory: 'lazy-enterprise',
fog_host: 'https://s3-eu-west-1.amazonaws.com/lazy-enterprise',
fog_public: true,
fog_credentials: {
provider: 'AWS',
// Получение значения Enum по строковому имени
//
EnumType dp = EnumType.None;
if(Enum.IsDefined(typeof(EnumType), enumElementName))
dp = (EnumType)Enum.Parse(typeof(EnumType), enumElementName);
else
Console.WriteLine("Sorry, no element exists!");