-
What is activerecord? dynamic orm object relational mapper database people -> Person songs -> Song song row -> <@name="thriller" @year=1982> object
-
How does it make our lives easier? reduces the amount of code that we have to write Song.find_by_year() conventions -> primary_key column Artist -> artists
-
How does it make our lives harder? may not follow conventions...
-
How does it work? Introspects on our tables, writes methods,
-
What questions do we have ActiveRecord::Base module ActiveRecord class Base end end
class ApplicationRecord < ActiveRecord::Base def self.find_by_id_and_name(id, name) end
def self.all raise 'no method' end
end
class User < ApplicationRecord end
class Song < ApplicationRecord end 5 minutes..
12-activerecord
Folders and files
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||