lib/couchrest/model/base.rb in couchrest_model-1.1.2 vs lib/couchrest/model/base.rb in couchrest_model-1.2.0.beta

- old
+ new

@@ -6,24 +6,19 @@ include CouchRest::Model::Configuration include CouchRest::Model::Connection include CouchRest::Model::Persistence include CouchRest::Model::DocumentQueries - include CouchRest::Model::Views - include CouchRest::Model::DesignDoc include CouchRest::Model::ExtendedAttachments - include CouchRest::Model::ClassProxy include CouchRest::Model::Proxyable - include CouchRest::Model::Collection include CouchRest::Model::PropertyProtection include CouchRest::Model::Associations include CouchRest::Model::Validations include CouchRest::Model::Callbacks include CouchRest::Model::Designs include CouchRest::Model::CastedBy include CouchRest::Model::Dirty - include CouchRest::Model::Callbacks def self.subclasses @subclasses ||= [] end @@ -63,24 +58,9 @@ yield self if block_given? after_initialize if respond_to?(:after_initialize) run_callbacks(:initialize) { self } - end - - - # Temp solution to make the view_by methods available - def self.method_missing(m, *args, &block) - if has_view?(m) - query = args.shift || {} - return view(m, query, *args, &block) - elsif m.to_s =~ /^find_(by_.+)/ - view_name = $1 - if has_view?(view_name) - return first_from_view(view_name, *args) - end - end - super end def to_key new? ? nil : [id] end