seven_gallery 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f35a69f37fbc5f026b0c4aa4b5a104712a8a3b98
|
4
|
+
data.tar.gz: 7ea0ddd3fb2ad47b44d4db3ca736c7c8595c2575
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54dd46052d8add9f7d37a6fbd8b4ff2147fb669abbe58c8b90082b0cb891df374ae06f502b637761624b09a308f76e4058e80be18779577d072769f7b9c3d33f
|
7
|
+
data.tar.gz: 29cf3790439bbae76740fdca66cc654e2adacf7c687955a360d105b15d08a6f030cc286210df1a264abf1c8e5507803dbd310799338c7b750fe1302dc1587a93
|
@@ -30,6 +30,7 @@ module SevenGallery::Concerns::PhotosController
|
|
30
30
|
|
31
31
|
def update
|
32
32
|
if @photo.update(photo_params)
|
33
|
+
session["end_url"] ||= request.referer
|
33
34
|
redirect_to @gallery, notice: 'Photo was successfully updated.'
|
34
35
|
else
|
35
36
|
render :edit
|
@@ -46,7 +47,7 @@ module SevenGallery::Concerns::PhotosController
|
|
46
47
|
@photos.reject! { |photo| photo.valid? }
|
47
48
|
if @photos.empty?
|
48
49
|
@valid_photos.map { |photo| photo.toggle!(:is_new) }
|
49
|
-
redirect_to @gallery
|
50
|
+
redirect_to session.delete(:end_url) || @gallery
|
50
51
|
else
|
51
52
|
render :photos_info
|
52
53
|
end
|
@@ -3,6 +3,6 @@ module SevenGallery::Concerns::Gallery
|
|
3
3
|
|
4
4
|
included do
|
5
5
|
has_many :photos, class_name: "SevenGallery::Photo", foreign_key: "seven_gallery_gallery_id", dependent: :destroy
|
6
|
-
|
6
|
+
default_scope { order("created_at desc") }
|
7
7
|
end
|
8
8
|
end
|
@@ -2,7 +2,7 @@ module SevenGallery::Concerns::Photo
|
|
2
2
|
extend ActiveSupport::Concern
|
3
3
|
|
4
4
|
included do
|
5
|
-
belongs_to :gallery, class_name: "SevenGallery::Gallery"
|
5
|
+
belongs_to :gallery, class_name: "SevenGallery::Gallery", foreign_key: "seven_gallery_gallery_id"
|
6
6
|
mount_uploader :image, SevenGallery::PhotoUploader
|
7
7
|
attr_accessor :crop_x, :crop_y, :crop_h, :crop_w
|
8
8
|
default_scope { order("position asc, created_at desc") }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seven_gallery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rafael
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|