Skip to content

Latest commit

 

History

History
150 lines (59 loc) · 1.49 KB

ActiveModel.rst

File metadata and controls

150 lines (59 loc) · 1.49 KB

ActiveModel

nodoc

Constants

Files

Methods

.all

ruby

def self.all(klass)

"#{klass}.all"

end

.build

ruby

def self.build(klass, params = nil)
if params

"#{klass}.new(#{params})"

else

"#{klass}.new"

end

end

#destroy

ruby

def destroy

"#{name}.destroy"

end

#errors

ruby

def errors

"#{name}.errors"

end

.find

ruby

def self.find(klass, params = nil)

"#{klass}.find(#{params})"

end

#save

ruby

def save

"#{name}.save"

end

#update_attributes

ruby

def update_attributes(params = nil)

"#{name}.update_attributes(#{params})"

end