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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 388d949a63a84ee79c002561c1072bc5838a7e2e
4
- data.tar.gz: 19e3b39ef264b70a5d865712e982156f74ec3145
3
+ metadata.gz: 92a9c127a3f1fb388603b635643e90c4069639bf
4
+ data.tar.gz: 67a69244746409b35ada1c5a6e0aed846753f660
5
5
  SHA512:
6
- metadata.gz: e7af2024485658ce6868acd5aaeec9e9d848e78b70f70a02337c5cae66ae4952d304f7634d5c444b9575ee40e0fa229850f1a8a964c6c851bd1843e826207b70
7
- data.tar.gz: e5a4ad536ec35311f9722e41e038d5270f4e4a52d467d82e86ec40dd5957f17b8609c02992c6a4d7b63f3c7607358db92bbf28dfae8362b718672a2e8f76b7ed
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, class_name.call)
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
@@ -1,3 +1,3 @@
1
1
  module ActsInRelation
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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 00:00:00.000000000 Z
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