Skip to content
This repository has been archived by the owner on Oct 26, 2021. It is now read-only.

Commit

Permalink
added some comments for mongomapper
Browse files Browse the repository at this point in the history
  • Loading branch information
jaigouk committed Jan 24, 2010
1 parent c3d4644 commit b08bc23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/generators/mongomapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# require 'rails/generators/migration'
require 'rails/generators/active_model'

module MongoMapper
module Mongomapper
module Generators
class Base < Rails::Generators::NamedBase #:nodoc:
# include Rails::Generators::Migration
Expand Down Expand Up @@ -38,7 +38,7 @@ def self.all(klass)
end

def self.find(klass, params=nil)
"#{klass}.get(#{params})"
"#{klass}.first(#{params})"
end

def self.build(klass, params=nil)
Expand All @@ -54,7 +54,7 @@ def save
end

def update_attributes(params=nil)
"#{name}.update(#{params})"
"#{name}.update(#{params})"
end

def errors
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/mongomapper/model/model_generator.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'generators/mongomapper'

module MongoMapper
module Mongomapper
module Generators
class ModelGenerator < Base
argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
Expand Down

0 comments on commit b08bc23

Please sign in to comment.