質問編集履歴
2
余分なコードを削りました
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,57 +10,7 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
-
```
|
14
|
-
|
15
|
-
Loading development environment (Rails 5.0.7.2)
|
16
|
-
|
17
|
-
irb(main):001:0> user = User.find_by(id: 1)
|
18
|
-
|
19
|
-
User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
|
20
|
-
|
21
|
-
=> #<User id: 1, name: "dsdsd", email: "dsdsdsasla;sla", created_at: "2019-10-23 10:27:02", updated_at: "2019-10-25 07:55:28", image_name: "1.jpg">
|
22
|
-
|
23
|
-
irb(main):002:0> user.password="kaji"
|
24
|
-
|
25
|
-
Traceback (most recent call last):
|
26
|
-
|
27
|
-
9: from bin/rails:4:in `<main>'
|
28
|
-
|
29
|
-
8: from bin/rails:4:in `require'
|
30
|
-
|
31
|
-
7: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.0.7.2/lib/rails/commands.rb:18:in `<top (required)>'
|
32
|
-
|
33
|
-
6: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.0.7.2/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
|
34
|
-
|
35
|
-
5: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.0.7.2/lib/rails/commands/commands_tasks.rb:78:in `console'
|
36
|
-
|
37
|
-
4: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.0.7.2/lib/rails/commands/console_helper.rb:9:in `start'
|
38
|
-
|
39
|
-
3: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-5.0.7.2/lib/rails/commands/console.rb:65:in `start'
|
40
|
-
|
41
|
-
2: from (irb):2
|
42
|
-
|
43
|
-
1: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/activemodel-5.0.7.2/lib/active_model/attribute_methods.rb:433:in `method_missing'
|
44
|
-
|
45
|
-
NoMethodError (undefined method `password=' for #<User:0x00000000087d5a48>)
|
46
|
-
|
47
|
-
irb(main):003:0> quit
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
C:\Users\kajim\OneDrive\ドキュメント\GitHub\ruby_rails\sample_app>rails g migration add_password_to_users
|
52
|
-
|
53
|
-
invoke active_record
|
54
|
-
|
55
|
-
conflict db/migrate/20191027055347_add_password_to_users.rb
|
56
|
-
|
57
|
-
Another migration is already named add_password_to_users: C:/Users/kajim/OneDrive/ドキュメント/GitHub/ruby_rails/sample_app/db/migrate/20191027052919_add_password_to_users.rb. Use --force to replace this migration or --skip to ignore conflicted file.
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
C:\Users\kajim\OneDrive\ドキュメント\GitHub\ruby_rails\sample_app>rails db:migrate
|
62
|
-
|
63
|
-
|
13
|
+
```
|
64
14
|
|
65
15
|
C:\Users\kajim\OneDrive\ドキュメント\GitHub\ruby_rails\sample_app>rails c
|
66
16
|
|
@@ -98,8 +48,6 @@
|
|
98
48
|
|
99
49
|
|
100
50
|
|
101
|
-
コード
|
102
|
-
|
103
51
|
```
|
104
52
|
|
105
53
|
### 該当のソースコード
|
1
e
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
-
C:\Users\kajim\OneDrive\ドキュメント\GitHub\ruby_rails\sample_app>rails c
|
13
|
+
```C:\Users\kajim\OneDrive\ドキュメント\GitHub\ruby_rails\sample_app>rails c
|
14
14
|
|
15
15
|
Loading development environment (Rails 5.0.7.2)
|
16
16
|
|
@@ -98,6 +98,10 @@
|
|
98
98
|
|
99
99
|
|
100
100
|
|
101
|
+
コード
|
102
|
+
|
103
|
+
```
|
104
|
+
|
101
105
|
### 該当のソースコード
|
102
106
|
|
103
107
|
|