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 CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
- :minor: 5
3
+ :minor: 6
4
4
  :patch: 0
@@ -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
- named_scope :include_values, lambda {
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
- named_scope :by_source, lambda { |source_type, source_id|
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
- named_scope :for_annotatable, lambda { |annotatable_type, annotatable_id|
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
- named_scope :with_attribute_name, lambda { |attrib_name|
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
- named_scope :with_attribute_names, lambda { |attrib_names|
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
- named_scope :with_value_type, lambda { |value_type|
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
- named_scope :include_values, lambda {
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
- named_scope :with_attribute_name, lambda { |attrib_name|
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
- named_scope :with_attribute_names, lambda { |attrib_names|
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
- named_scope :with_value_type, lambda { |value_type|
35
+ scope :with_value_type, lambda { |value_type|
36
36
  { :conditions => { :value_type => value_type },
37
37
  :order => "created_at DESC" }
38
38
  }
@@ -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.5.1'
6
- s.date = '2013-05-02'
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: 9
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 5
9
- - 1
10
- version: 0.5.1
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-02 00:00:00 +01:00
20
+ date: 2013-05-08 00:00:00 +01:00
21
21
  default_executable:
22
22
  dependencies: []
23
23