Module: LocusFocus::Acts::PolymorphicPaperclip::ExtentionMethods

Defined in:
lib/sga/acts_as_polymorphic_paperclip.rb

Instance Method Summary collapse

Instance Method Details

#asset_path(create_dir = false) ⇒ Object



86
87
88
89
90
91
# File 'lib/sga/acts_as_polymorphic_paperclip.rb', line 86

def asset_path create_dir=false
  assets_dir = File.join RAILS_ROOT, 'public', 'system', 'assets'
  (FileUtils.mkdir_p assets_dir unless File.exists?(assets_dir)) if create_dir
  sgf_file = "#{wuid_host ? self.send(wuid_host).wid : self.wid}.sgf"
  File.join assets_dir, sgf_file
end

#copy_pic_to_assets_directoryObject



82
83
84
# File 'lib/sga/acts_as_polymorphic_paperclip.rb', line 82

def copy_pic_to_assets_directory 
  FileUtils.cp assets[0].path, asset_path(true)   
end