marks 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/marks/markable.rb +7 -0
- data/lib/marks/version.rb +1 -1
- metadata +20 -4
data/lib/marks/markable.rb
CHANGED
@@ -13,6 +13,13 @@ module Marks
|
|
13
13
|
klass = class_name.to_s.classify.constantize
|
14
14
|
klass.joins(:outgoing_marks).where('marks_marks.mark_type = ? AND markable_type = ? AND markable_id = ?', mark.to_s.classify, self.class.base_class.to_s, self)
|
15
15
|
end
|
16
|
+
|
17
|
+
define_method :'marked_by?' do |marker, mark|
|
18
|
+
classified_mark = mark.to_s.classify
|
19
|
+
raise ArgumentError unless types.map { |t| t.to_s.classify }.include?(classified_mark)
|
20
|
+
klass = marker.class.table_name.classify.constantize
|
21
|
+
klass.joins(:outgoing_marks).where('marks_marks.mark_type = ? AND markable_type = ? AND markable_id = ?', mark.to_s.classify, self.class.base_class.to_s, self).any?
|
22
|
+
end
|
16
23
|
end
|
17
24
|
end
|
18
25
|
end
|
data/lib/marks/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -59,6 +59,22 @@ dependencies:
|
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: pry
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
62
78
|
description: An engine that enable you to mark any ActiveRecord model as many as you
|
63
79
|
like
|
64
80
|
email:
|
@@ -92,7 +108,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
92
108
|
version: '0'
|
93
109
|
segments:
|
94
110
|
- 0
|
95
|
-
hash:
|
111
|
+
hash: 2361575609532956099
|
96
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
113
|
none: false
|
98
114
|
requirements:
|
@@ -101,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
117
|
version: '0'
|
102
118
|
segments:
|
103
119
|
- 0
|
104
|
-
hash:
|
120
|
+
hash: 2361575609532956099
|
105
121
|
requirements: []
|
106
122
|
rubyforge_project:
|
107
123
|
rubygems_version: 1.8.23
|