From 7f1f05cbca6918cdd3842ad3a5483221ebec5440 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Fri, 6 May 2011 11:23:14 -0700 Subject: [PATCH 1/3] Dumped supported rails versions --- couchrest_model.gemspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/couchrest_model.gemspec b/couchrest_model.gemspec index 6a8947f..8d54a83 100644 --- a/couchrest_model.gemspec +++ b/couchrest_model.gemspec @@ -25,9 +25,9 @@ Gem::Specification.new do |s| s.add_dependency(%q, "1.1.0.pre2") s.add_dependency(%q, "~> 1.15") - s.add_dependency(%q, "~> 3.0.0") + s.add_dependency(%q, "~> 3.0") s.add_dependency(%q, "~> 0.3.22") - s.add_dependency(%q, "~> 3.0.0") + s.add_dependency(%q, "~> 3.0") s.add_development_dependency(%q, ">= 2.0.0") s.add_development_dependency(%q, ">= 0.5.7") # s.add_development_dependency("jruby-openssl", ">= 0.7.3") From 2b0dc2b779a8f3788dfe5523c4d9ccbd77d9fb5e Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Fri, 6 May 2011 13:32:49 -0700 Subject: [PATCH 2/3] Removed unneeded require --- lib/couchrest_model.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/couchrest_model.rb b/lib/couchrest_model.rb index 7de6b41..8892ea4 100644 --- a/lib/couchrest_model.rb +++ b/lib/couchrest_model.rb @@ -1,7 +1,6 @@ require 'active_model' require "active_model/callbacks" require "active_model/conversion" -require "active_model/deprecated_error_methods" require "active_model/errors" require "active_model/naming" require "active_model/serialization" From 2669de9511d95c8d13205dfd39355cdcc553d395 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Mon, 9 May 2011 09:47:27 -0600 Subject: [PATCH 3/3] Use class_attribute rather than extlib_inheritable_attribute (which is removed in rails 3.1) --- lib/couchrest/model/properties.rb | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/lib/couchrest/model/properties.rb b/lib/couchrest/model/properties.rb index 229c5bc..7f78444 100644 --- a/lib/couchrest/model/properties.rb +++ b/lib/couchrest/model/properties.rb @@ -5,26 +5,13 @@ module CouchRest extend ActiveSupport::Concern included do - extlib_inheritable_accessor(:properties) unless self.respond_to?(:properties) - extlib_inheritable_accessor(:properties_by_name) unless self.respond_to?(:properties_by_name) + class_attribute(:properties) unless self.respond_to?(:properties) + class_attribute(:properties_by_name) unless self.respond_to?(:properties_by_name) self.properties ||= [] self.properties_by_name ||= {} raise "You can only mixin Properties in a class responding to [] and []=, if you tried to mixin CastedModel, make sure your class inherits from Hash or responds to the proper methods" unless (method_defined?(:[]) && method_defined?(:[]=)) end - # Returns the Class properties - # - # ==== Returns - # Array:: the list of properties for model's class - def properties - self.class.properties - end - - # Returns all the class's properties as a Hash where the key is the name - # of the property. - def properties_by_name - self.class.properties_by_name - end # Returns the Class properties with their values #