ecm_blog 0.2.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/ecm/blog/posts_controller.rb +6 -9
- data/lib/ecm/blog/version.rb +1 -1
- data/lib/generators/ecm/blog/install/install_generator.rb +9 -4
- data/lib/generators/ecm/blog/install/templates/initializer.rb +3 -3
- data/lib/generators/ecm/blog/install/templates/routes.source +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a83b2849b7fee1e82e79056744eecbb21cc3c047
|
4
|
+
data.tar.gz: e8ed2920068f5e47fb3d9d0c1c473987defebd9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ac4bf41724ee62f6a7f6a01c3e26519cedc87753baf02a907eaa65d8053e3633db4d310b9c61c745f08e39ab70ecbac75b3bf79dfd4798d859ee49d0b78dc81
|
7
|
+
data.tar.gz: 71b1200de61c315dd7afc34f88553429445aab8ed04f18965aecc7ddf3f694b2acdf13e79896cba74cf35ba56837fb190c139590f574a886d770c42b4c8cb5a0
|
@@ -1,10 +1,11 @@
|
|
1
1
|
module Ecm
|
2
2
|
module Blog
|
3
3
|
class PostsController < Ecm::Blog::Configuration.base_controller.constantize
|
4
|
-
include
|
5
|
-
include
|
6
|
-
include
|
7
|
-
include
|
4
|
+
include ResourcesController::Resources
|
5
|
+
include ResourcesController::ResourceInflections
|
6
|
+
include ResourcesController::RestResourceUrls
|
7
|
+
include ResourcesController::RestActions
|
8
|
+
include ResourcesController::Kaminari
|
8
9
|
|
9
10
|
helper Ecm::Comments::ApplicationHelper
|
10
11
|
|
@@ -14,14 +15,10 @@ module Ecm
|
|
14
15
|
|
15
16
|
private
|
16
17
|
|
17
|
-
def
|
18
|
+
def load_collection_scope
|
18
19
|
super.published.friendly.order(updated_at: :desc)
|
19
20
|
end
|
20
21
|
|
21
|
-
def load_collection
|
22
|
-
collection_scope.page(params[:page])
|
23
|
-
end
|
24
|
-
|
25
22
|
def load_scope
|
26
23
|
super.published.friendly
|
27
24
|
end
|
data/lib/ecm/blog/version.rb
CHANGED
@@ -6,14 +6,19 @@ module Ecm
|
|
6
6
|
|
7
7
|
source_root File.expand_path('../templates', __FILE__)
|
8
8
|
|
9
|
+
attr_reader :base_controller_class_name
|
10
|
+
|
11
|
+
def initialize(*args)
|
12
|
+
super
|
13
|
+
@base_controller_class_name = ENV.fetch('BASE_CONTROLLER_CLASS_NAME') { '::FrontendController' }
|
14
|
+
end
|
15
|
+
|
9
16
|
def generate_initializer
|
10
|
-
|
17
|
+
template 'initializer.rb', 'config/initializers/ecm_blog.rb'
|
11
18
|
end
|
12
19
|
|
13
20
|
def generate_routes
|
14
|
-
|
15
|
-
File.read(File.join(File.expand_path('../templates', __FILE__), 'routes.source'))
|
16
|
-
end
|
21
|
+
route File.read(File.join(File.expand_path('../templates', __FILE__), 'routes.source'))
|
17
22
|
end
|
18
23
|
end
|
19
24
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
Ecm::Blog.configure do |config|
|
2
|
-
# Set the base controller for the
|
2
|
+
# Set the base controller for the page controller
|
3
3
|
#
|
4
|
-
# Default: config.base_controller = '
|
4
|
+
# Default: config.base_controller = '<%= base_controller_class_name %>'
|
5
5
|
#
|
6
|
-
config.base_controller = '
|
6
|
+
config.base_controller = '<%= base_controller_class_name %>'
|
7
7
|
|
8
8
|
config.creator_class_name = 'User'
|
9
9
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecm_blog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.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:
|
11
|
+
date: 2018-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|