ecm_downloads2 5.0.0 → 5.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/ecm/downloads/download.rb +1 -7
- data/app/models/ecm/downloads/download_category.rb +0 -10
- data/config/locales/ecm.downloads.de.yml +1 -1
- data/config/locales/ecm.downloads.en.yml +1 -1
- data/config/routes.rb +2 -1
- data/db/migrate/001_create_ecm_downloads_download_categories.rb +1 -1
- data/db/migrate/002_create_ecm_downloads_downloads.rb +1 -1
- data/lib/ecm/downloads/version.rb +1 -1
- data/spec/factories/ecm_downloads_download.rb +7 -0
- data/spec/factories/{ecm/downloads/download_category.rb → ecm_downloads_download_categories.rb} +1 -1
- metadata +5 -6
- data/spec/factories/ecm/downloads/download.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 456136de30ecda9957cadc0c41bada6ded670538
|
4
|
+
data.tar.gz: 8cd392b8c17a7408d154bc4fca352a253cb25b70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd29318a6fb84415be4233abb35e59bca76f4ab0f6fb017bc0c86325cf9c6d3b23fadcce5dd07b8927c414ba347bf904bbad926847edee80b62dbcbe1a04665e
|
7
|
+
data.tar.gz: 0bcaeeadc53f740b39d298206a4f05effdf6b1198cf072bdd7d81e462d4c64f8c40bb40c0f246cc98909d2170ee40fc60280fd3d275e8ceb4a40c32cf07a1539
|
@@ -12,14 +12,8 @@ module Ecm
|
|
12
12
|
belongs_to :download_category,
|
13
13
|
inverse_of: :downloads
|
14
14
|
|
15
|
-
# attibutes
|
16
|
-
attr_accessible :asset,
|
17
|
-
:description,
|
18
|
-
:download_category_id,
|
19
|
-
:name if respond_to? :attr_accessible
|
20
|
-
|
21
15
|
# callbacks
|
22
|
-
before_update :fix_updated_position, if: proc { |d| !position.blank? && d.
|
16
|
+
before_update :fix_updated_position, if: proc { |d| !position.blank? && d.download_category_id_changed? }
|
23
17
|
|
24
18
|
# friendly id
|
25
19
|
extend FriendlyId
|
@@ -10,16 +10,6 @@ module Ecm
|
|
10
10
|
accepts_nested_attributes_for :downloads,
|
11
11
|
allow_destroy: true
|
12
12
|
|
13
|
-
# attributes
|
14
|
-
attr_accessible :description,
|
15
|
-
:downloads_attributes,
|
16
|
-
:downloads_count,
|
17
|
-
:locale,
|
18
|
-
:name,
|
19
|
-
:parent_id,
|
20
|
-
:position,
|
21
|
-
:slug if respond_to? :attr_accessible
|
22
|
-
|
23
13
|
# awesome nested set
|
24
14
|
acts_as_nested_set
|
25
15
|
default_scope { order('lft ASC') }
|
data/config/routes.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
Ecm::Downloads::Engine.routes.draw do
|
2
2
|
localized do
|
3
|
-
scope :
|
3
|
+
scope :ecm_downloads_engine do
|
4
4
|
resources :download_categories, only: [:index, :show]
|
5
5
|
resources :downloads, only: [:index, :show] do
|
6
6
|
get :download, on: :member
|
7
7
|
end
|
8
|
+
|
8
9
|
root to: 'download_categories#index'
|
9
10
|
end
|
10
11
|
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
FactoryGirl.define do
|
2
|
+
factory :ecm_downloads_download, class: Ecm::Downloads::Download do
|
3
|
+
sequence(:name) { |i| "Download ##{i}" }
|
4
|
+
association :download_category, factory: :ecm_downloads_download_category
|
5
|
+
asset { File.open(Ecm::Downloads::Engine.root.join(*%w(spec files ecm downloads download asset.txt))) }
|
6
|
+
end
|
7
|
+
end
|
data/spec/factories/{ecm/downloads/download_category.rb → ecm_downloads_download_categories.rb}
RENAMED
@@ -3,7 +3,7 @@ FactoryGirl.define do
|
|
3
3
|
sequence(:name) { |i| "Download category ##{i}" }
|
4
4
|
locale I18n.default_locale.to_s
|
5
5
|
|
6
|
-
factory :
|
6
|
+
factory :download_category_with_parent do
|
7
7
|
locale nil
|
8
8
|
association :parent, factory: :ecm_downloads_download_category
|
9
9
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecm_downloads2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.1
|
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-
|
11
|
+
date: 2017-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -507,8 +507,8 @@ files:
|
|
507
507
|
- lib/generators/ecm/downloads/install/templates/routes.source
|
508
508
|
- lib/generators/ecm/downloads/locales/locales_generator.rb
|
509
509
|
- lib/tasks/ecm_downloads_tasks.rake
|
510
|
-
- spec/factories/
|
511
|
-
- spec/factories/
|
510
|
+
- spec/factories/ecm_downloads_download.rb
|
511
|
+
- spec/factories/ecm_downloads_download_categories.rb
|
512
512
|
- spec/files/ecm/downloads/download/asset.txt
|
513
513
|
homepage: https://github.com/robotex82/ecm_downloads
|
514
514
|
licenses: []
|
@@ -529,9 +529,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
529
529
|
version: '0'
|
530
530
|
requirements: []
|
531
531
|
rubyforge_project:
|
532
|
-
rubygems_version: 2.
|
532
|
+
rubygems_version: 2.6.11
|
533
533
|
signing_key:
|
534
534
|
specification_version: 4
|
535
535
|
summary: Provides downloads for active admin.
|
536
536
|
test_files: []
|
537
|
-
has_rdoc:
|
@@ -1,7 +0,0 @@
|
|
1
|
-
FactoryGirl.define do
|
2
|
-
factory :ecm_downloads_download, class: Ecm::Downloads::Download do
|
3
|
-
sequence(:name) { |i| "Download ##{i}" }
|
4
|
-
ecm_downloads_download_category
|
5
|
-
asset { File.open(File.join(Ecm::Downloads::Engine.root, 'spec/files', 'ecm/downloads', 'download/asset.txt')) }
|
6
|
-
end
|
7
|
-
end
|