diff options
author | soartec-lab <info@soartec-lab.work> | 2019-04-11 23:04:41 +0900 |
---|---|---|
committer | soartec-lab <info@soartec-lab.work> | 2019-04-11 23:04:41 +0900 |
commit | c816dde055108217a8bd34147a07830dc4063ff8 (patch) | |
tree | 1a03ed60f68f4dd3eea49e8da99eb5d12828c5ea | |
parent | 45511fa8b20c621e2cf193ddaeb7d6fbe8432fea (diff) | |
download | rails-c816dde055108217a8bd34147a07830dc4063ff8.tar.gz rails-c816dde055108217a8bd34147a07830dc4063ff8.tar.bz2 rails-c816dde055108217a8bd34147a07830dc4063ff8.zip |
Use modele to generate generated defaults [skip ci]
-rw-r--r-- | guides/source/engines.md | 31 |
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 ``` |