app/models/setting.rb
# Change the picture origin size
# with size define in setting
Change the picture origin size
with size define in setting
Change the picture origin size with size define in setting
def change_picture_size
    if change_size_view?
      Picture.attachment_options[:thumbnails] = { 
        :view => "#{Setting.default.picture_max_width}x#{Setting.default.picture_max_height}>"
      }
      Picture.all.each { |pic| 
        Import.create!(:picture_id => pic.id, 
                       :type_pic => Import::VIEW,
                       :total => Picture.count)
      }
    end
  end
def change_picture_size if change_size_view? Picture . attachment_options [ :thumbnails ] = { :view => "#{Setting.default.picture_max_width}x#{Setting.default.picture_max_height}>" } Picture . all . each { | pic | Import . create! ( :picture_id => pic . id , :type_pic => Import :: VIEW , :total => Picture . count ) } end end
Change the picture origin size
with size define in setting
Change the picture origin size with size define in setting