mix-rails-albums 0.23.0 → 0.23.1

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.
@@ -10,14 +10,14 @@ module Concerns::Album
10
10
  enumerize :status, in: [:published, :unpublished], default: :published, predicates: true
11
11
  friendly_id :title, use: :slugged
12
12
 
13
- has_many :photos, :as => :related
13
+ has_many :photos, :as => :related, dependent: :destroy
14
14
  belongs_to :related, :polymorphic => true
15
15
 
16
16
  validation_for_title
17
17
  validation_for_date
18
18
 
19
19
 
20
- scope :published, where(status: :published).joins(:photos).having("count(photos.id) > 1")
20
+ scope :published, includes(:photos).where(status: :published).having('COUNT(photos.id) > 0')
21
21
 
22
22
  end
23
23
 
@@ -50,11 +50,8 @@ class Albums::ImageUploader < CarrierWave::Uploader::Base
50
50
 
51
51
  albums_watermark = Setting.albums_watermark
52
52
 
53
- #raise albums_watermark.image
54
-
55
53
  watermark_image = if albums_watermark
56
- gridfs_file = MixRailsCore::Gridfs::read_file(albums_watermark.image.url)
57
- MiniMagick::Image.read(gridfs_file, "png")
54
+ MiniMagick::Image.open("#{Rails.root}/public#{albums_watermark.image.url}", "png")
58
55
  else
59
56
  # We can read a file from system too.
60
57
  #MiniMagick::Image.open("#{Rails.root}/app/assets/images/watermarks/watermark.png", "png")
@@ -3,8 +3,8 @@ pt-BR:
3
3
  albums: 'albuns'
4
4
  photos: 'fotos'
5
5
  will_paginate:
6
- previous_label: "<< admix"
7
- next_label: "próximo >>"
6
+ previous_label: "anterior"
7
+ next_label: "próximo"
8
8
  albums:
9
9
  published_yes: 'Sim'
10
10
  published_no: 'Não'
@@ -2,7 +2,7 @@ module MixRailsAlbums
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 23
5
- TINY = 0
5
+ TINY = 1
6
6
  PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mix-rails-albums
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.0
4
+ version: 0.23.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-08 00:00:00.000000000 Z
12
+ date: 2013-02-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -168,7 +168,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
168
168
  version: '0'
169
169
  segments:
170
170
  - 0
171
- hash: -1145099264192215353
171
+ hash: -4085379778431430325
172
172
  required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  none: false
174
174
  requirements:
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  version: '0'
178
178
  segments:
179
179
  - 0
180
- hash: -1145099264192215353
180
+ hash: -4085379778431430325
181
181
  requirements: []
182
182
  rubyforge_project:
183
183
  rubygems_version: 1.8.24