ecm_pictures 0.0.18 → 0.0.19
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.
|
@@ -15,7 +15,7 @@ class Ecm::Pictures::Picture < ActiveRecord::Base
|
|
|
15
15
|
acts_as_list :scope => :picture_gallery
|
|
16
16
|
|
|
17
17
|
# callbacks
|
|
18
|
-
before_validation :set_name_from_image_file_name, :if => Proc.new { |p| p.name.nil? }
|
|
18
|
+
before_validation :set_name_from_image_file_name, :if => Proc.new { |p| ( p.name.nil? || p.name.empty? ) }
|
|
19
19
|
|
|
20
20
|
# default scope
|
|
21
21
|
default_scope :order => "picture_gallery_id, position ASC"
|
data/lib/ecm/pictures/version.rb
CHANGED
|
@@ -47,7 +47,7 @@ namespace :ecm do
|
|
|
47
47
|
50.times do
|
|
48
48
|
Ecm::Pictures::Picture.create! do |p|
|
|
49
49
|
p.picture_gallery = picture_galleries.choice
|
|
50
|
-
p.image = File.open(File.join(
|
|
50
|
+
p.image = File.open(File.join(Ecm::Pictures::Engine.root, 'spec/files', 'ecm/pictures/pictures', 'example.jpg'))
|
|
51
51
|
p.name = Faker::Product.brand if (rand(2) == 1)
|
|
52
52
|
p.description = Faker::Lorem.paragraph(rand(10))
|
|
53
53
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ecm_pictures
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 57
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 0
|
|
9
|
-
-
|
|
10
|
-
version: 0.0.
|
|
9
|
+
- 19
|
|
10
|
+
version: 0.0.19
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Roberto Vasquez Angel
|