organizer-rails 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/models/concerns/organizer/identifiable.rb +12 -9
- data/lib/organizer/version.rb +1 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbe7dc049f0299d1cb5354f8ff08982077fae71faeaa9323754b3dbd895c0800
|
4
|
+
data.tar.gz: 2fcda84259a43a8137d0dfc86f9932f82588795f96acc545850fa0ca30ebaa0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51336e2f715dc1ad52120575ea33d023df747b47accda40f063bb5cc165aee07f290312114b8564e8f5bb2e281eb811c24c58185fd26a3f792b761eb636db081
|
7
|
+
data.tar.gz: d7640ccdd0a5991b7d41746b9e86dee2bf33d483f0dd27f7d4134fc30e1683e1668d7ce1dc1f2940a521dc74090472497dc535a7b2424d0f3123127e71c13976
|
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'memery'
|
2
|
+
|
1
3
|
module Organizer
|
2
4
|
concern :Identifiable do
|
3
5
|
class << self
|
@@ -8,7 +10,8 @@ module Organizer
|
|
8
10
|
@identified_by = column_name
|
9
11
|
end
|
10
12
|
|
11
|
-
class_methods do
|
13
|
+
class_methods do
|
14
|
+
# public API
|
12
15
|
define_method(column_name.to_s.pluralize) { identifiers }
|
13
16
|
end
|
14
17
|
end
|
@@ -17,7 +20,9 @@ module Organizer
|
|
17
20
|
end
|
18
21
|
|
19
22
|
class_methods do
|
20
|
-
|
23
|
+
include Memery
|
24
|
+
|
25
|
+
def [] * id
|
21
26
|
return id.map { self[_1] } if id.many?
|
22
27
|
|
23
28
|
case id = id.first
|
@@ -31,15 +36,13 @@ module Organizer
|
|
31
36
|
|
32
37
|
private
|
33
38
|
|
34
|
-
def identifiers
|
35
|
-
@
|
36
|
-
|
37
|
-
.map &:to_sym
|
39
|
+
memoize def identifiers
|
40
|
+
all.pluck(@identified_by)
|
41
|
+
.map &:to_sym
|
38
42
|
end
|
39
43
|
|
40
|
-
def identified_as identifier
|
41
|
-
|
42
|
-
find_by @identified_by => identifier
|
44
|
+
memoize def identified_as identifier
|
45
|
+
find_by @identified_by => identifier
|
43
46
|
end
|
44
47
|
end
|
45
48
|
end
|
data/lib/organizer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: organizer-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Senko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '7.1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: memery
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
description: Use lists, tags, flags, etc. to organize your application records.
|
28
42
|
email:
|
29
43
|
- Alexander.Senko@gmail.com
|
@@ -58,7 +72,7 @@ licenses:
|
|
58
72
|
metadata:
|
59
73
|
homepage_uri: https://github.com/Alexander-Senko/organizer
|
60
74
|
source_code_uri: https://github.com/Alexander-Senko/organizer
|
61
|
-
changelog_uri: https://github.com/Alexander-Senko/organizer/CHANGELOG.md
|
75
|
+
changelog_uri: https://github.com/Alexander-Senko/organizer/blob/v0.1.3/CHANGELOG.md
|
62
76
|
post_install_message:
|
63
77
|
rdoc_options: []
|
64
78
|
require_paths:
|
@@ -74,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
88
|
- !ruby/object:Gem::Version
|
75
89
|
version: '0'
|
76
90
|
requirements: []
|
77
|
-
rubygems_version: 3.5.
|
91
|
+
rubygems_version: 3.5.5
|
78
92
|
signing_key:
|
79
93
|
specification_version: 4
|
80
94
|
summary: Record organizer for Rails
|