redactor-rails 0.4.4 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 197aed0bed73abd0306f05a7951eab03b601e7f2
|
4
|
+
data.tar.gz: 60e3476d5358fbea31c5509ffc1b0d3a9a98ce41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c0dcb5db44233fc959847ecbc22f752199f5786a4b0cfd22880284e8659792fd7093d47e2d456bf7d8d743118d8d622a78f0cb29e2819cb817c2549bf958d4f
|
7
|
+
data.tar.gz: b1d9940a45550ef33bc7c43a5ed1997dc93089f0efbabf95a4c759489f6ad6bdbd1316d3bb822f95f48ae826f02b437132816c7e8ea60ab72d09c45e07a6a1a7
|
@@ -12,7 +12,7 @@ class RedactorRails::DocumentsController < ApplicationController
|
|
12
12
|
|
13
13
|
file = params[:file]
|
14
14
|
@document.data = RedactorRails::Http.normalize_param(file, request)
|
15
|
-
if @document.
|
15
|
+
if @document.has_attribute?(:"#{RedactorRails.devise_user_key}")
|
16
16
|
@document.send("#{RedactorRails.devise_user}=", redactor_current_user)
|
17
17
|
@document.assetable = redactor_current_user
|
18
18
|
end
|
@@ -27,7 +27,7 @@ class RedactorRails::DocumentsController < ApplicationController
|
|
27
27
|
private
|
28
28
|
|
29
29
|
def redactor_authenticate_user!
|
30
|
-
if RedactorRails.document_model.new.
|
30
|
+
if RedactorRails.document_model.new.has_attribute?(RedactorRails.devise_user)
|
31
31
|
super
|
32
32
|
end
|
33
33
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class RedactorRails::PicturesController < ApplicationController
|
2
|
-
|
2
|
+
before_filter :redactor_authenticate_user!
|
3
3
|
|
4
4
|
def index
|
5
5
|
@pictures = RedactorRails.picture_model.where(
|
@@ -12,7 +12,7 @@ class RedactorRails::PicturesController < ApplicationController
|
|
12
12
|
|
13
13
|
file = params[:file]
|
14
14
|
@picture.data = RedactorRails::Http.normalize_param(file, request)
|
15
|
-
if @picture.
|
15
|
+
if @picture.has_attribute?(:"#{RedactorRails.devise_user_key}")
|
16
16
|
@picture.send("#{RedactorRails.devise_user}=", redactor_current_user)
|
17
17
|
@picture.assetable = redactor_current_user
|
18
18
|
end
|
@@ -27,7 +27,7 @@ class RedactorRails::PicturesController < ApplicationController
|
|
27
27
|
private
|
28
28
|
|
29
29
|
def redactor_authenticate_user!
|
30
|
-
if RedactorRails.picture_model.new.
|
30
|
+
if RedactorRails.picture_model.new.has_attribute?(RedactorRails.devise_user)
|
31
31
|
super
|
32
32
|
end
|
33
33
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
class CreateRedactorAssets < ActiveRecord::Migration
|
2
2
|
def self.up
|
3
3
|
create_table :redactor_assets do |t|
|
4
|
-
t.integer :user_id
|
5
4
|
t.string :data_file_name, :null => false
|
6
5
|
t.string :data_content_type
|
7
6
|
t.integer :data_file_size
|
@@ -27,4 +26,3 @@ class CreateRedactorAssets < ActiveRecord::Migration
|
|
27
26
|
drop_table :redactor_assets
|
28
27
|
end
|
29
28
|
end
|
30
|
-
|