I don't have an object yet
all
Model.all => fetch all the items from the databasecreate
Model.create(:hour => 1, :emotion => "super stoked")
=> create a new model in the databasenew
Model.new => build a new model but don't save itfirst
Model.first => fetches the first onelast
Model.last => fetches the last onefind
Model.find(1) => fetches one with the id we give itwhere
Model.where(:hour => 1, :emotion => 'happy') => fetch all of models that have the "hour" set to "1"
Ok I have an object
destroy
Model.destroy => delete the item from the databaseupdate_attributes
Model.update_attributes(:hour => 3) => update the attributes on the model