Skip to content

Commit 7af392f

Browse files
joelyleszzak
authored andcommitted
Bracket spaces and double quotes added for lint check [ci skip]
1 parent 68714ea commit 7af392f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

guides/source/getting_started.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,12 +1763,12 @@ class Article < ApplicationRecord
17631763
validates :title, presence: true
17641764
validates :body, presence: true, length: { minimum: 10 }
17651765

1766-
VALID_STATUSES = ['public', 'private', 'archived']
1766+
VALID_STATUSES = [ "public", "private", "archived" ]
17671767

17681768
validates :status, inclusion: { in: VALID_STATUSES }
17691769

17701770
def archived?
1771-
status == 'archived'
1771+
status == "archived"
17721772
end
17731773
end
17741774
```
@@ -1779,12 +1779,12 @@ and in the `Comment` model:
17791779
class Comment < ApplicationRecord
17801780
belongs_to :article
17811781

1782-
VALID_STATUSES = ['public', 'private', 'archived']
1782+
VALID_STATUSES = [ "public", "private", "archived" ]
17831783

17841784
validates :status, inclusion: { in: VALID_STATUSES }
17851785

17861786
def archived?
1787-
status == 'archived'
1787+
status == "archived"
17881788
end
17891789
end
17901790
```
@@ -1832,7 +1832,7 @@ A concern is only responsible for a focused subset of the model's responsibility
18321832
```ruby
18331833
module Visible
18341834
def archived?
1835-
status == 'archived'
1835+
status == "archived"
18361836
end
18371837
end
18381838
```
@@ -1843,14 +1843,14 @@ We can add our status validation to the concern, but this is slightly more compl
18431843
module Visible
18441844
extend ActiveSupport::Concern
18451845

1846-
VALID_STATUSES = ['public', 'private', 'archived']
1846+
VALID_STATUSES = [ "public", "private", "archived" ]
18471847

18481848
included do
18491849
validates :status, inclusion: { in: VALID_STATUSES }
18501850
end
18511851

18521852
def archived?
1853-
status == 'archived'
1853+
status == "archived"
18541854
end
18551855
end
18561856
```
@@ -1887,20 +1887,20 @@ Class methods can also be added to concerns. If we want to display a count of pu
18871887
module Visible
18881888
extend ActiveSupport::Concern
18891889

1890-
VALID_STATUSES = ['public', 'private', 'archived']
1890+
VALID_STATUSES = [ "public", "private", "archived" ]
18911891

18921892
included do
18931893
validates :status, inclusion: { in: VALID_STATUSES }
18941894
end
18951895

18961896
class_methods do
18971897
def public_count
1898-
where(status: 'public').count
1898+
where(status: "public").count
18991899
end
19001900
end
19011901

19021902
def archived?
1903-
status == 'archived'
1903+
status == "archived"
19041904
end
19051905
end
19061906
```

0 commit comments

Comments
 (0)