learn-co-curriculum / active-record-mechanics-crud Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
Hi, I finished reading this page, and went on trying to work on the Mechanics of Migration lab.
Can you add information in this read me AND in the Mechanics of Migration lab on where to add code to connect to DB and creating table using sql? I ended up having to skip some of the SQL lessons and went to Active Record lessons first. Not sure if this information is already obvious through the SQL lessons but can you add info about where to add the following code? The current instructions simply say, "This is how we would connect to a database" and "Let's create our table using SQL:" but it doesn't tell us exactly where the code should be. I think it would be a great help for future students as well. Thanks.
connection = ActiveRecord::Base.establish_connection(
:adapter => "sqlite3",
:database => "db/students.sqlite"
)
and
sql = <<-SQL
CREATE TABLE IF NOT EXISTS students (
id INTEGER PRIMARY KEY,
name TEXT
)
SQL
ActiveRecord::Base.connection.execute(sql)
Hi there.
First line's verb should be "By now you ARE familiar..."
"ORM vs Active Record
By now you be familiar with the concept of an ORM, an Object-Relation Mapper, and should have written something of your own in the Student and InteractiveRecord classes. Our latest iteration was our most powerful yet, it could give us lots of functionality via inheritance."
The gem is installed via gem install activerecord.
Need a lower-case T in the middle of this sentence:
"And as a result, Active Record gives you enormous functionality (Think of our ORM with a lot more methods)."
Thank you.
A table is created called students. Afterwards the examples mix in instances of songs and artists. There is no uniformity. Here is the example that was used to describe the .find_by method:
Student.find_by(name: 'Jon')
The rake file lab has a part where we run the statement rake greeting:hello from the terminal. Doing so causes an error for me. At first it was a bundle install thing. Did that and still an error posts. The error rake aborted! Don't know how to build task 'greeting:hello' (see --tasks)
ATURKEWI SAID 2 MINUTES AGO
Hey Richard!
ATURKEWI SAID 2 MINUTES AGO
So it looks like we need to update this lab a little bit.
ATURKEWI SAID A MINUTE AGO
You can see a list of all possible rake tasks if you run rake -T
ATURKEWI SAID A MINUTE AGO
## And we can see there is no rake greeting:hello
RNHUTSKO SAID A MINUTE AGO
yep. That is it.
ATURKEWI SAID A MINUTE AGO
There is just rake hello
BY NOW YOU BE FAMILIAR with the concept of an ORM, an Object-Relation Mapper, and should have written something of your own in the Student and InteractiveRecord classes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.