acts_in_relation 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/acts_in_relation/core.rb +5 -8
- data/lib/acts_in_relation/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92a9c127a3f1fb388603b635643e90c4069639bf
|
4
|
+
data.tar.gz: 67a69244746409b35ada1c5a6e0aed846753f660
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d42116922125188f848c9a50abc955bffc5840381b9686f35bd4701ce3bbc1144e2e50f2117d8d69fdfbd9928807fcbfda13282a46523d2f719fe36cc12d96c
|
7
|
+
data.tar.gz: 1c31f8d090a83f85241becd3878518ed4bd645b8764c78cac3170f90417937c15be2fd6e1804914d4fd4ceb248c8914d876ee01df969327d219143937ec4cd63
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'caller_class'
|
2
|
+
|
1
3
|
module ActsInRelation
|
2
4
|
module Core
|
3
5
|
def self.included(base)
|
@@ -5,17 +7,12 @@ module ActsInRelation
|
|
5
7
|
end
|
6
8
|
|
7
9
|
module ClassMethods
|
10
|
+
include CallerClass
|
11
|
+
|
8
12
|
def acts_in_relation(position = :self, params)
|
9
|
-
relation = Relation.new(position, params,
|
13
|
+
relation = Relation.new(position, params, caller_class.downcase)
|
10
14
|
relation.define
|
11
15
|
end
|
12
|
-
|
13
|
-
private
|
14
|
-
|
15
|
-
# TODO: Implement this method to return reliable class name
|
16
|
-
def class_name
|
17
|
-
-> { caller_locations(3, 1)[0].label.match(/^\<class:(\w+)\>$/)[1].downcase.to_sym }
|
18
|
-
end
|
19
16
|
end
|
20
17
|
|
21
18
|
class Relation
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_in_relation
|
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
|
- kami
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: caller_class
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: sqlite3
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|