cookbook 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/VERSION +1 -1
- data/app/models/cookbook/use.rb +12 -0
- data/cookbook.gemspec +3 -3
- data/lib/cookbook/mixins/acts_as_use_of.rb +15 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66fccc09592729e8aab5d9403f01231956d438110e706976b10c5bbfd30d7984
|
4
|
+
data.tar.gz: 5914fed8d04d5db8fd409e22e627f8f0461a4908a1c6fa21fd328c5d042da7ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8db914804526e40973d712443bdf7d5d096b8e8a838bf0a80590dfb5cf95d937b5e2d95b419fcf24d4c1841464b776aa4723ad35c30a51b7e9f97fa5ddc0e659
|
7
|
+
data.tar.gz: 4e848e7186bb761911e2bda14ef95587c0b6d1323cbc0a2a2be0edc25411a9bf4c4030cc90ca005a4771b3b1fcf86b61ed32b02ee8c2b90624bd34ce8806c127
|
data/README.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# Works Cited
|
2
2
|
Works Cited allows you to add a list of the works cited in ActiveRecord objects, to be formatted by a helper that can be added to relevant pages to format the citations like a bibliography.
|
3
3
|
|
4
|
-
Works Cited
|
4
|
+
Works Cited can be configured to use CanCanCan to authorize the editing of citations. This makes it easy for you to control access.
|
5
|
+
|
6
|
+
Works Cited does not require, but is compatible with Rails Admin.
|
5
7
|
|
6
8
|
## Installation
|
7
9
|
Add this line to your application's Gemfile:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/app/models/cookbook/use.rb
CHANGED
@@ -22,5 +22,17 @@ module Cookbook
|
|
22
22
|
|
23
23
|
[min, max].compact.join('–') # ndash, not hyphen
|
24
24
|
end
|
25
|
+
|
26
|
+
if defined?(RailsAdmin)
|
27
|
+
rails_admin do
|
28
|
+
visible false
|
29
|
+
edit do
|
30
|
+
include_all_fields
|
31
|
+
field :use_in do
|
32
|
+
visible false
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
25
37
|
end
|
26
38
|
end
|
data/cookbook.gemspec
CHANGED
@@ -2,17 +2,17 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: cookbook 0.1.
|
5
|
+
# stub: cookbook 0.1.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "cookbook".freeze
|
9
|
-
s.version = "0.1.
|
9
|
+
s.version = "0.1.1"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.metadata = { "source_code_uri" => "http://github.com/gemvein/cookbook" } if s.respond_to? :metadata=
|
13
13
|
s.require_paths = ["lib".freeze]
|
14
14
|
s.authors = ["Loren Lundgren".freeze]
|
15
|
-
s.date = "2021-09-
|
15
|
+
s.date = "2021-09-13"
|
16
16
|
s.description = "Cookbook allows you to associate instructions with components in a cross referenced way. Good for cooking recipes or an instruction manual for DIY projects.".freeze
|
17
17
|
s.email = "loren.lundgren@gmail.com".freeze
|
18
18
|
s.executables = ["rails".freeze]
|
@@ -22,7 +22,8 @@ module Cookbook
|
|
22
22
|
attr_accessor(:used_in)
|
23
23
|
|
24
24
|
def associate_used_in
|
25
|
-
|
25
|
+
tables = used_in
|
26
|
+
tables.each do |table_sym|
|
26
27
|
model = table_sym.to_s.classify.constantize
|
27
28
|
name = model.model_name.to_s
|
28
29
|
uses_symbol = "#{model.model_name.param_key}_uses".to_sym
|
@@ -33,6 +34,19 @@ module Cookbook
|
|
33
34
|
accepts_nested_attributes_for uses_symbol, reject_if: :all_blank, allow_destroy: true
|
34
35
|
|
35
36
|
has_many table_sym, through: :uses, source: :use_of, source_type: name
|
37
|
+
|
38
|
+
if defined?(RailsAdmin)
|
39
|
+
rails_admin do
|
40
|
+
field :uses do
|
41
|
+
visible false
|
42
|
+
end
|
43
|
+
tables.each do |table_sym|
|
44
|
+
field table_sym do # We don't want these associations to show
|
45
|
+
visible false
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
36
50
|
end
|
37
51
|
end
|
38
52
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cookbook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Loren Lundgren
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|