diff --git a/VERSION.yml b/VERSION.yml index c887d85..e132101 100644 --- a/VERSION.yml +++ b/VERSION.yml @@ -1,4 +1,4 @@ --- :major: 0 -:minor: 5 +:minor: 6 :patch: 0 diff --git a/lib/app/models/annotation.rb b/lib/app/models/annotation.rb index 62dbcc3..1dd49eb 100644 --- a/lib/app/models/annotation.rb +++ b/lib/app/models/annotation.rb @@ -75,33 +75,33 @@ def value_content # Named scope to allow you to include the value records too. # Use this to *potentially* improve performance. - named_scope :include_values, lambda { + scope :include_values, lambda { { :include => [ :value ] } } # Finder to get all annotations by a given source. - named_scope :by_source, lambda { |source_type, source_id| + scope :by_source, lambda { |source_type, source_id| { :conditions => { :source_type => source_type, :source_id => source_id }, :order => "created_at DESC" } } # Finder to get all annotations for a given annotatable. - named_scope :for_annotatable, lambda { |annotatable_type, annotatable_id| + scope :for_annotatable, lambda { |annotatable_type, annotatable_id| { :conditions => { :annotatable_type => annotatable_type, :annotatable_id => annotatable_id }, :order => "created_at DESC" } } # Finder to get all annotations with a given attribute_name. - named_scope :with_attribute_name, lambda { |attrib_name| + scope :with_attribute_name, lambda { |attrib_name| { :conditions => { :annotation_attributes => { :name => attrib_name } }, :joins => :attribute, :order => "created_at DESC" } } # Finder to get all annotations with one of the given attribute_names. - named_scope :with_attribute_names, lambda { |attrib_names| + scope :with_attribute_names, lambda { |attrib_names| conditions = [attrib_names.collect{"annotation_attributes.name = ?"}.join(" or ")] | attrib_names { :conditions => conditions, :joins => :attribute, @@ -109,7 +109,7 @@ def value_content } # Finder to get all annotations for a given value_type. - named_scope :with_value_type, lambda { |value_type| + scope :with_value_type, lambda { |value_type| { :conditions => { :value_type => value_type }, :order => "created_at DESC" } } diff --git a/lib/app/models/annotation_value_seed.rb b/lib/app/models/annotation_value_seed.rb index eb8361b..f20d0e1 100644 --- a/lib/app/models/annotation_value_seed.rb +++ b/lib/app/models/annotation_value_seed.rb @@ -12,19 +12,19 @@ class AnnotationValueSeed < ActiveRecord::Base # Named scope to allow you to include the value records too. # Use this to *potentially* improve performance. - named_scope :include_values, lambda { + scope :include_values, lambda { { :include => [ :value ] } } # Finder to get all annotation value seeds with a given attrib_name. - named_scope :with_attribute_name, lambda { |attrib_name| + scope :with_attribute_name, lambda { |attrib_name| { :conditions => { :annotation_attributes => { :name => attrib_name } }, :joins => :attribute, :order => "created_at DESC" } } # Finder to get all annotation value seeds with one of the given attrib_names. - named_scope :with_attribute_names, lambda { |attrib_names| + scope :with_attribute_names, lambda { |attrib_names| conditions = [attrib_names.collect{"annotation_attributes.name = ?"}.join(" or ")] | attrib_names { :conditions => conditions, :joins => :attribute, @@ -32,7 +32,7 @@ class AnnotationValueSeed < ActiveRecord::Base } # Finder to get all annotations for a given value_type. - named_scope :with_value_type, lambda { |value_type| + scope :with_value_type, lambda { |value_type| { :conditions => { :value_type => value_type }, :order => "created_at DESC" } } diff --git a/my_annotations.gemspec b/my_annotations.gemspec index 86f5392..738ed05 100644 --- a/my_annotations.gemspec +++ b/my_annotations.gemspec @@ -2,8 +2,8 @@ require 'rake' Gem::Specification.new do |s| s.name = 'my_annotations' - s.version = '0.5.1' - s.date = '2013-05-02' + s.version = '0.6.0' + s.date = '2013-05-08' 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." 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." s.authors = ["Jiten Bhagat","Stuart Owen","Quyen Nguyen"]