Skip to content
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

Merged
merged 24 commits into from May 27, 2017

Conversation

wikimatze
Copy link
Member

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?

@@ -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
Copy link
Collaborator

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.

Copy link
Member Author

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
Copy link
Collaborator

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.

Copy link
Member Author

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
Copy link
Collaborator

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.

Copy link
Member Author

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
Copy link
Collaborator

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.

Copy link
Member Author

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.

Copy link
Member Author

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
Copy link
Collaborator

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True

@adam12
Copy link
Collaborator

adam12 commented May 26, 2017

Everything looks good. I ran through it locally and had no issues. 👍 Thanks for carrying this over the finish line.

Do you think we should also remove the old Padrino 0.12.2 part as well as the sceencast?

I think so. No point in encouraging people to use an extremely old version.

@wikimatze
Copy link
Member Author

I think, it' ready now.

@adam12
Copy link
Collaborator

adam12 commented May 26, 2017

👍 Looks good.

@wikimatze wikimatze merged commit 2d1fedd into master May 27, 2017
@wikimatze wikimatze deleted the adam12-issue-119/blog-tutorial-improvements branch May 27, 2017 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants