diff --git a/Rakefile b/Rakefile index c296968..928ae7f 100644 --- a/Rakefile +++ b/Rakefile @@ -24,7 +24,7 @@ begin gemspec.extra_rdoc_files = %w( README.md LICENSE THANKS.md ) gemspec.files = %w( LICENSE README.md Rakefile THANKS.md history.txt couchrest.gemspec) + Dir["{examples,lib,spec,utils}/**/*"] - Dir["spec/tmp"] gemspec.has_rdoc = true - gemspec.add_dependency("couchrest", ">= 1.0.0.beta") + gemspec.add_dependency("couchrest", ">= 1.0.0.beta1") gemspec.add_dependency("mime-types", ">= 1.15") gemspec.add_dependency("activesupport", ">= 2.3.5") gemspec.version = CouchRest::ExtendedDocument::VERSION diff --git a/history.txt b/history.txt index 4214618..f143d73 100644 --- a/history.txt +++ b/history.txt @@ -11,6 +11,7 @@ * Fixed issue with active_support in Rails3 and text in README for JSON. * Refactoring of properties, added read_attribute and write_attribute methods. * Now possible to send anything to update_attribtues method. Invalid or readonly attributes will be ignored. + * Updating to use couchrest_inheritable_attributes to avoid possible Rails conflicts * Major enhancements * Added support for anonymous CastedModels defined in Documents diff --git a/lib/couchrest/extended_document.rb b/lib/couchrest/extended_document.rb index 2aaf63d..e04d7f6 100644 --- a/lib/couchrest/extended_document.rb +++ b/lib/couchrest/extended_document.rb @@ -8,7 +8,7 @@ module CouchRest # Same as CouchRest::Document but with properties and validations class ExtendedDocument < Document - VERSION = "1.0.0.beta5" + VERSION = "1.0.0.beta6" include CouchRest::Mixins::Callbacks include CouchRest::Mixins::DocumentQueries diff --git a/lib/couchrest/mixins/callbacks.rb b/lib/couchrest/mixins/callbacks.rb index 989fe25..4b7899a 100644 --- a/lib/couchrest/mixins/callbacks.rb +++ b/lib/couchrest/mixins/callbacks.rb @@ -370,6 +370,8 @@ def clone(klass) end module ClassMethods + extend CouchRest::InheritableAttributes + #CHAINS = {:before => :before, :around => :before, :after => :after} # Make the _run_save_callbacks method. The generated method takes @@ -497,9 +499,9 @@ def skip_callback(name, *filters, &block) def define_callbacks(*symbols) terminator = symbols.pop if symbols.last.is_a?(String) symbols.each do |symbol| - extlib_inheritable_accessor("_#{symbol}_terminator") { terminator } + couchrest_inheritable_accessor("_#{symbol}_terminator") { terminator } - extlib_inheritable_accessor("_#{symbol}_callback") do + couchrest_inheritable_accessor("_#{symbol}_callback") do CallbackChain.new(symbol) end diff --git a/lib/couchrest/mixins/properties.rb b/lib/couchrest/mixins/properties.rb index 44fd1cf..e636231 100644 --- a/lib/couchrest/mixins/properties.rb +++ b/lib/couchrest/mixins/properties.rb @@ -10,7 +10,8 @@ class IncludeError < StandardError; end def self.included(base) base.class_eval <<-EOS, __FILE__, __LINE__ + 1 - extlib_inheritable_accessor(:properties) unless self.respond_to?(:properties) + extend CouchRest::InheritableAttributes + couchrest_inheritable_accessor(:properties) unless self.respond_to?(:properties) self.properties ||= [] EOS base.extend(ClassMethods) diff --git a/lib/couchrest/validation.rb b/lib/couchrest/validation.rb index b0b7604..06f7058 100644 --- a/lib/couchrest/validation.rb +++ b/lib/couchrest/validation.rb @@ -48,8 +48,10 @@ module CouchRest module Validation def self.included(base) - base.extlib_inheritable_accessor(:auto_validation) base.class_eval <<-EOS, __FILE__, __LINE__ + 1 + extend CouchRest::InheritableAttributes + couchrest_inheritable_accessor(:auto_validation) + # Callbacks define_callbacks :validate