my_annotations 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/app/models/annotation.rb +6 -6
- data/lib/app/models/annotation_value_seed.rb +4 -4
- data/my_annotations.gemspec +2 -2
- metadata +5 -5
data/VERSION.yml
CHANGED
@@ -75,33 +75,33 @@
|
|
75
75
|
|
76
76
|
# Named scope to allow you to include the value records too.
|
77
77
|
# Use this to *potentially* improve performance.
|
78
|
-
|
78
|
+
scope :include_values, lambda {
|
79
79
|
{ :include => [ :value ] }
|
80
80
|
}
|
81
81
|
|
82
82
|
# Finder to get all annotations by a given source.
|
83
|
-
|
83
|
+
scope :by_source, lambda { |source_type, source_id|
|
84
84
|
{ :conditions => { :source_type => source_type,
|
85
85
|
:source_id => source_id },
|
86
86
|
:order => "created_at DESC" }
|
87
87
|
}
|
88
88
|
|
89
89
|
# Finder to get all annotations for a given annotatable.
|
90
|
-
|
90
|
+
scope :for_annotatable, lambda { |annotatable_type, annotatable_id|
|
91
91
|
{ :conditions => { :annotatable_type => annotatable_type,
|
92
92
|
:annotatable_id => annotatable_id },
|
93
93
|
:order => "created_at DESC" }
|
94
94
|
}
|
95
95
|
|
96
96
|
# Finder to get all annotations with a given attribute_name.
|
97
|
-
|
97
|
+
scope :with_attribute_name, lambda { |attrib_name|
|
98
98
|
{ :conditions => { :annotation_attributes => { :name => attrib_name } },
|
99
99
|
:joins => :attribute,
|
100
100
|
:order => "created_at DESC" }
|
101
101
|
}
|
102
102
|
|
103
103
|
# Finder to get all annotations with one of the given attribute_names.
|
104
|
-
|
104
|
+
scope :with_attribute_names, lambda { |attrib_names|
|
105
105
|
conditions = [attrib_names.collect{"annotation_attributes.name = ?"}.join(" or ")] | attrib_names
|
106
106
|
{ :conditions => conditions,
|
107
107
|
:joins => :attribute,
|
@@ -109,7 +109,7 @@
|
|
109
109
|
}
|
110
110
|
|
111
111
|
# Finder to get all annotations for a given value_type.
|
112
|
-
|
112
|
+
scope :with_value_type, lambda { |value_type|
|
113
113
|
{ :conditions => { :value_type => value_type },
|
114
114
|
:order => "created_at DESC" }
|
115
115
|
}
|
@@ -12,19 +12,19 @@ class AnnotationValueSeed < ActiveRecord::Base
|
|
12
12
|
|
13
13
|
# Named scope to allow you to include the value records too.
|
14
14
|
# Use this to *potentially* improve performance.
|
15
|
-
|
15
|
+
scope :include_values, lambda {
|
16
16
|
{ :include => [ :value ] }
|
17
17
|
}
|
18
18
|
|
19
19
|
# Finder to get all annotation value seeds with a given attrib_name.
|
20
|
-
|
20
|
+
scope :with_attribute_name, lambda { |attrib_name|
|
21
21
|
{ :conditions => { :annotation_attributes => { :name => attrib_name } },
|
22
22
|
:joins => :attribute,
|
23
23
|
:order => "created_at DESC" }
|
24
24
|
}
|
25
25
|
|
26
26
|
# Finder to get all annotation value seeds with one of the given attrib_names.
|
27
|
-
|
27
|
+
scope :with_attribute_names, lambda { |attrib_names|
|
28
28
|
conditions = [attrib_names.collect{"annotation_attributes.name = ?"}.join(" or ")] | attrib_names
|
29
29
|
{ :conditions => conditions,
|
30
30
|
:joins => :attribute,
|
@@ -32,7 +32,7 @@ class AnnotationValueSeed < ActiveRecord::Base
|
|
32
32
|
}
|
33
33
|
|
34
34
|
# Finder to get all annotations for a given value_type.
|
35
|
-
|
35
|
+
scope :with_value_type, lambda { |value_type|
|
36
36
|
{ :conditions => { :value_type => value_type },
|
37
37
|
:order => "created_at DESC" }
|
38
38
|
}
|
data/my_annotations.gemspec
CHANGED
@@ -2,8 +2,8 @@ require 'rake'
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'my_annotations'
|
5
|
-
s.version = '0.
|
6
|
-
s.date = '2013-05-
|
5
|
+
s.version = '0.6.0'
|
6
|
+
s.date = '2013-05-08'
|
7
7
|
s.summary = "This gem allows arbitrary metadata and relationships to be stored and retrieved, in the form of Annotations for any model objects in your Ruby on Rails (v2.2+) application."
|
8
8
|
s.description = "This gem allows arbitrary metadata and relationships to be stored and retrieved, in the form of Annotations for any model objects in your Ruby on Rails (v2.2+) application."
|
9
9
|
s.authors = ["Jiten Bhagat","Stuart Owen","Quyen Nguyen"]
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: my_annotations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 6
|
9
|
+
- 0
|
10
|
+
version: 0.6.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jiten Bhagat
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2013-05-
|
20
|
+
date: 2013-05-08 00:00:00 +01:00
|
21
21
|
default_executable:
|
22
22
|
dependencies: []
|
23
23
|
|