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: f20922bff0ece3ee1228257a19fab8b826330cad
4
- data.tar.gz: eeb4406914ee038c772bbad04d0de0cb60d8c55c
3
+ metadata.gz: f35a69f37fbc5f026b0c4aa4b5a104712a8a3b98
4
+ data.tar.gz: 7ea0ddd3fb2ad47b44d4db3ca736c7c8595c2575
5
5
  SHA512:
6
- metadata.gz: 3337201d10824007e8a610292a1d61871a0fc70ddd06d5badb9c73495a7de003d302820ddbc73c7b4f845d86f13460af754c5c43a765383de1040447e4bd34b1
7
- data.tar.gz: 02b48dc12f49ab5f99034ff31c1fa985e1cc70f31b35d8e8c1819c6bcccbfc0ea307f39f86ae3d07b75b371c167b2b9d028110880b019ae2668eff8a8c0cc788
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
- default_scope { order("created_at desc") }
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") }
@@ -1,3 +1,3 @@
1
1
  module SevenGallery
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
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.5
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-04-08 00:00:00.000000000 Z
11
+ date: 2015-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails