New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adam12 issue 119/blog tutorial improvements #142
Adam12 issue 119/blog tutorial improvements #142
Conversation
Most new users would likely be best skipping this step.
By default, the user will be prompted for the values they want.
@@ -257,29 +259,35 @@ the `-a` option to the command - this is handy if you would like to have models | |||
should be coped only to sub-apps. | |||
|
|||
```shell | |||
$ padrino g model post title:string body:text | |||
apply orms/activerecord | |||
$ padrino g model post title:string body:text created_ad:datetime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should likely be created_at
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true
class Account < Sequel::Model; end | ||
class Post < Sequel::Model | ||
many_to_one :account | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need these class definitions in this migration file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree!
class Account < Sequel::Model; end | ||
class Post < Sequel::Model | ||
many_to_one :account | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's drop the class definitions from this migration too. I can't see them being required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay
```shell | ||
$ padrino g project sample_blog --template sampleblog | ||
$ padrino g project blog-tutorial --template blogtutorial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line won't work as the blogtutorial
template isn't available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But until this is created, I'll comment this out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But until this is created, I'll comment this out.
Padrino.before_load do | ||
Padrino.dependency_paths << Padrino.root('models/**/*.rb') | ||
class Account < Sequel::Model | ||
one_to_one :post |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
one_to_many :posts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True
Everything looks good. I ran through it locally and had no issues. 👍 Thanks for carrying this over the finish line.
I think so. No point in encouraging people to use an extremely old version. |
I think, it' ready now. |
👍 Looks good. |
Take the PR (#120) of @adam12 as a foundation. Have switched from AR to Sequel, remove deployment section.
Do you think we should also remove the old Padrino 0.12.2 part as well as the sceencast?