aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/engines.md
diff options
context:
space:
mode:
authorsoartec-lab <info@soartec-lab.work>2019-04-11 23:04:41 +0900
committersoartec-lab <info@soartec-lab.work>2019-04-11 23:04:41 +0900
commitc816dde055108217a8bd34147a07830dc4063ff8 (patch)
tree1a03ed60f68f4dd3eea49e8da99eb5d12828c5ea /guides/source/engines.md
parent45511fa8b20c621e2cf193ddaeb7d6fbe8432fea (diff)
downloadrails-c816dde055108217a8bd34147a07830dc4063ff8.tar.gz
rails-c816dde055108217a8bd34147a07830dc4063ff8.tar.bz2
rails-c816dde055108217a8bd34147a07830dc4063ff8.zip
Use modele to generate generated defaults [skip ci]
Diffstat (limited to 'guides/source/engines.md')
-rw-r--r--guides/source/engines.md31
1 files changed, 17 insertions, 14 deletions
diff --git a/guides/source/engines.md b/guides/source/engines.md
index 5446c1c188..b79cf409d0 100644
--- a/guides/source/engines.md
+++ b/guides/source/engines.md
@@ -1129,10 +1129,11 @@ end
```
```ruby
-# Blorgh/app/models/article.rb
-
-class Article < ApplicationRecord
- has_many :comments
+# Blorgh/app/models/blorgh/article.rb
+module Blorgh
+ class Article < ApplicationRecord
+ has_many :comments
+ end
end
```
@@ -1150,12 +1151,13 @@ end
```
```ruby
-# Blorgh/app/models/article.rb
-
-class Article < ApplicationRecord
- has_many :comments
- def summary
- "#{title}"
+# Blorgh/app/models/blorgh/article.rb
+module Blorgh
+ class Article < ApplicationRecord
+ has_many :comments
+ def summary
+ "#{title}"
+ end
end
end
```
@@ -1187,10 +1189,11 @@ end
```
```ruby
-# Blorgh/app/models/article.rb
-
-class Article < ApplicationRecord
- include Blorgh::Concerns::Models::Article
+# Blorgh/app/models/blorgh/article.rb
+module Blorgh
+ class Article < ApplicationRecord
+ include Blorgh::Concerns::Models::Article
+ end
end
```