active_content 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_content/metable.rb +0 -4
- data/lib/active_content/templatable.rb +6 -6
- data/lib/active_content/version.rb +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: 8ea1d71cf07f41372716f69a3188f3c27b132f61
|
4
|
+
data.tar.gz: 771a12d7d2780d9f055119e5e1105bf17a92ab4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fa1d9ecab98318479e0c14d3413eb26613739ff268cf1289934a3de05a042d4db62d85d5ac04b1413ae1e2dbaabe9b80a8f69dea57bbe8b8427e50c35c9adef
|
7
|
+
data.tar.gz: ef0ed67a470e62a34780e0b4f801bc47819bbb2674812559697a34f80fd56877c8090c419303d821829f74659cd1d29ce7fa08baa05ce81abc88be3f4aaa8015
|
@@ -3,18 +3,18 @@ module ActiveContent
|
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
5
|
class_methods do
|
6
|
-
def has_templates(*
|
6
|
+
def has_templates(*args)
|
7
7
|
extend Enumerize
|
8
8
|
include ActiveDelegate
|
9
9
|
|
10
|
-
|
10
|
+
options = args.extract_options!
|
11
|
+
templates = args
|
12
|
+
default = options.fetch :default, templates.first
|
13
|
+
|
14
|
+
enumerize :template, in: templates, predicates: { prefix: true }, default: default
|
11
15
|
|
12
16
|
has_one :view_template, as: :templatable, class_name: 'ActiveContent::Template', autosave: true, dependent: :destroy
|
13
17
|
delegate_attribute :name, :string, to: :view_template, prefix: 'template', alias: :template, finder: true, scope: true
|
14
|
-
|
15
|
-
before_save do
|
16
|
-
self.view_template = nil if template.blank?
|
17
|
-
end
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_content
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Olibia Tsati
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-12-
|
12
|
+
date: 2017-12-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|