Class: Ripple::Generators::ActiveModel
- Inherits:
-
Rails::Generators::ActiveModel
- Object
- Rails::Generators::ActiveModel
- Ripple::Generators::ActiveModel
- Defined in:
- lib/rails/generators/ripple_generator.rb
Overview
Generator for a Document model
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.all(klass) ⇒ Object
33 34 35 |
# File 'lib/rails/generators/ripple_generator.rb', line 33 def self.all(klass) "#{klass}.list" end |
.build(klass, params = nil) ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/rails/generators/ripple_generator.rb', line 41 def self.build(klass, params=nil) if params "#{klass}.new(#{params})" else "#{klass}.new" end end |
.find(klass, params = nil) ⇒ Object
37 38 39 |
# File 'lib/rails/generators/ripple_generator.rb', line 37 def self.find(klass, params=nil) "#{klass}.find(#{params})" end |
Instance Method Details
#destroy ⇒ Object
61 62 63 |
# File 'lib/rails/generators/ripple_generator.rb', line 61 def destroy "#{name}.destroy" end |
#errors ⇒ Object
57 58 59 |
# File 'lib/rails/generators/ripple_generator.rb', line 57 def errors "#{name}.errors" end |
#save ⇒ Object
49 50 51 |
# File 'lib/rails/generators/ripple_generator.rb', line 49 def save "#{name}.save" end |
#update_attributes(params = nil) ⇒ Object
53 54 55 |
# File 'lib/rails/generators/ripple_generator.rb', line 53 def update_attributes(params=nil) "#{name}.update_attributes(#{params})" end |