Commit b6d6fa33
Changed files (3)
app
models
app/models/avatar.rb
@@ -1,6 +1,7 @@
class Avatar < ActiveRecord::Base
belongs_to :user
mount_uploader :avatar, AvatarUploader
+ process_in_background :avatar
def attach(file)
self.avatar=file
db/migrate/20131230060957_add_is_processing_and_tmp_path_to_avatars.rb
@@ -0,0 +1,6 @@
+class AddIsProcessingAndTmpPathToAvatars < ActiveRecord::Migration
+ def change
+ add_column :avatars, :avatar_processing, :boolean
+ add_column :avatars, :avatar_tmp, :string
+ end
+end
db/schema.rb
@@ -11,16 +11,18 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20131230054711) do
+ActiveRecord::Schema.define(version: 20131230060957) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "avatars", force: true do |t|
t.integer "user_id"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
t.string "avatar"
+ t.boolean "avatar_processing"
+ t.string "avatar_tmp"
end
add_index "avatars", ["user_id"], name: "index_avatars_on_user_id", using: :btree