ecm_pictures2 5.0.1 → 5.1.0

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: fa9163d84a8641a25a59d7860e197aefbf72bd5a
4
- data.tar.gz: a76358758a64858a21dad007447e2e60d91cb364
3
+ metadata.gz: 9d2eb95b79a43b2c784d1296c5013cc9c4775a7e
4
+ data.tar.gz: a81d19f9a09e294d0015d74b343d4626176aafed
5
5
  SHA512:
6
- metadata.gz: 162a282b808e8b1475f00b7967791f7c08eab07bd614486e5f786ea05587fb64c1d366ddf3948a109247b9cf1ac76fd6326e2ea86d0fe3b5b0c48720809841ae
7
- data.tar.gz: a9e6cc132904eec1b3a6193e426acfa328f8d9a2c54fb51d1689158cf8fc60eb777e69318afe25817046e402bcde5100f65cb3742a7d1cd9795296a6b9c6c909
6
+ metadata.gz: 12f30ed06ed70686e7ac9ee6da41f11b7ad2a278f83604f32945a26bfefad9b4905894efa2dfd39a052a6f4811235ae11c3b150a4abfc13a1e356e838f1906ff
7
+ data.tar.gz: f8205fa0b4fd60bfc370f516882409e2ad0b51cd6968f725b6ea463104b1789138cdcf2790595637fe9858f9459a8127be8aae2425ac41dbf8c18b3e1e67baa5
@@ -2,7 +2,7 @@ module Ecm
2
2
  module Pictures
3
3
  class Picture < ActiveRecord::Base
4
4
  # associations
5
- belongs_to :gallery, counter_cache: true
5
+ belongs_to :gallery, optional: true
6
6
  has_many :attached_pictures, foreign_key: 'ecm_pictures_picture_id'
7
7
 
8
8
  # acts as list
@@ -28,6 +28,7 @@ module Ecm
28
28
 
29
29
  # validations
30
30
  validates :image, attachment_presence: true
31
+ validates_attachment :image, size: { in: 0..Ecm::Pictures.maximum_image_file_size } unless Ecm::Pictures.maximum_image_file_size.nil?
31
32
  # validates_attachment_presence :image
32
33
  validates_attachment :image, content_type: { content_type: /\Aimage\/.*\Z/ }
33
34
 
@@ -26,6 +26,13 @@ de:
26
26
  actions:
27
27
  back: 'Zurück'
28
28
  routes:
29
- ecm_pictures: bilder
29
+ ecm_picture_engine: bilder
30
30
  galleries: galerien
31
- pictures: bilder
31
+ pictures: bilder
32
+ activerecord:
33
+ errors:
34
+ models:
35
+ ecm/pictures/picture:
36
+ attributes:
37
+ image_file_size:
38
+ in_between: Die Dateigröße überschreitet das maximum von 1 Megabyte.
@@ -17,6 +17,6 @@ en:
17
17
  actions:
18
18
  back: 'Back'
19
19
  routes:
20
- ecm_pictures: pictures
20
+ ecm_picture_engine: pictures
21
21
  galleries: galleries
22
22
  pictures: pictures
data/config/routes.rb CHANGED
@@ -1,9 +1,9 @@
1
1
  Ecm::Pictures::Engine.routes.draw do
2
2
  localized do
3
- scope :ecm_pictures do
3
+ scope :ecm_picture_engine do
4
4
  resources :galleries, only: [:index, :show]
5
5
  resources :pictures, only: [:index, :show]
6
-
6
+
7
7
  root to: 'galleries#index'
8
8
  end
9
9
  end
@@ -1,4 +1,4 @@
1
- class CreateEcmPicturesPictureGalleries < ActiveRecord::Migration
1
+ class CreateEcmPicturesPictureGalleries < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :ecm_pictures_picture_galleries do |t|
4
4
  t.string :name
@@ -1,4 +1,4 @@
1
- class CreateEcmPicturesPictures < ActiveRecord::Migration
1
+ class CreateEcmPicturesPictures < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :ecm_pictures_pictures do |t|
4
4
  t.string :name
@@ -1,4 +1,4 @@
1
- class CreateEcmPicturesAttachedPictures < ActiveRecord::Migration
1
+ class CreateEcmPicturesAttachedPictures < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :ecm_pictures_attached_pictures do |t|
4
4
  t.references :ecm_pictures_picture
@@ -1,4 +1,4 @@
1
- class RenameEcmPicturesPictureGalleriesToEcmPicturesGalleries < ActiveRecord::Migration
1
+ class RenameEcmPicturesPictureGalleriesToEcmPicturesGalleries < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  rename_table :ecm_pictures_picture_galleries, :ecm_pictures_galleries
4
4
  end
@@ -1,4 +1,4 @@
1
- class RenameEcmPicturesPicturesPictureGalleryIdToGalleryId < ActiveRecord::Migration
1
+ class RenameEcmPicturesPicturesPictureGalleryIdToGalleryId < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  rename_column :ecm_pictures_pictures, :picture_gallery_id, :gallery_id
4
4
  end
@@ -44,6 +44,14 @@ module Ecm
44
44
  mattr_accessor :thumbnail_paperclip_style do
45
45
  :original
46
46
  end
47
+
48
+ mattr_accessor :maximum_image_file_size do
49
+ nil
50
+ end
51
+
52
+ mattr_accessor :pictureable_factory_name do
53
+ :post
54
+ end
47
55
  end
48
56
  end
49
57
  end
@@ -1,5 +1,5 @@
1
1
  module Ecm
2
2
  module Pictures
3
- VERSION = '5.0.1'
3
+ VERSION = '5.1.0'
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  FactoryGirl.define do
2
2
  factory :ecm_pictures_attached_picture, class: Ecm::Pictures::AttachedPicture do
3
3
  picture factory: :ecm_pictures_picture
4
- pictureable factory: :post
4
+ pictureable factory: (Ecm::Pictures.pictureable_factory_name || :post)
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm_pictures2
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-07 00:00:00.000000000 Z
11
+ date: 2017-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -397,7 +397,6 @@ files:
397
397
  - spec/factories/ecm/pictures/attached_pictures.rb
398
398
  - spec/factories/ecm/pictures/galleries.rb
399
399
  - spec/factories/ecm/pictures/pictures.rb
400
- - spec/factories/post.rb
401
400
  - spec/files/ecm/pictures/picture/image.jpg
402
401
  homepage: https://github.com/robotex82/ecm_pictures
403
402
  licenses: []
@@ -418,7 +417,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
418
417
  version: '0'
419
418
  requirements: []
420
419
  rubyforge_project:
421
- rubygems_version: 2.6.10
420
+ rubygems_version: 2.6.11
422
421
  signing_key:
423
422
  specification_version: 4
424
423
  summary: ECM Picture galleries module for ruby on rails.
@@ -1,5 +0,0 @@
1
- FactoryGirl.define do
2
- factory :post do
3
- sequence(:title) { |i| "Post ##{i}" }
4
- end
5
- end