Class: Sequel::Generators::ActiveModel

Inherits:
Rails::Generators::ActiveModel
  • Object
show all
Defined in:
lib/generators/sequel.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all(klass) ⇒ Object



36
37
38
# File 'lib/generators/sequel.rb', line 36

def self.all(klass)
  "#{klass}.all"
end

.build(klass, params = nil) ⇒ Object



44
45
46
47
48
49
50
# File 'lib/generators/sequel.rb', line 44

def self.build(klass, params=nil)
  if params
    "#{klass}.new(#{params})"
  else
    "#{klass}.new"
  end
end

.find(klass, params = nil) ⇒ Object



40
41
42
# File 'lib/generators/sequel.rb', line 40

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

Instance Method Details

#destroyObject



64
65
66
# File 'lib/generators/sequel.rb', line 64

def destroy
  "#{name}.destroy"
end

#errorsObject



60
61
62
# File 'lib/generators/sequel.rb', line 60

def errors
  "#{name}.errors"
end

#saveObject



52
53
54
# File 'lib/generators/sequel.rb', line 52

def save
  "#{name}.save"
end

#update_attributes(params = nil) ⇒ Object



56
57
58
# File 'lib/generators/sequel.rb', line 56

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