Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-settings.php on line 472

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-settings.php on line 487

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-settings.php on line 494

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-settings.php on line 530

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-includes/cache.php on line 103

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-includes/query.php on line 21

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-includes/theme.php on line 623

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/custom_posts/custom_posts.php on line 22

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/pukiwiki.php on line 46

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/pukiwiki.php on line 67

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/pukiwiki.php on line 75

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/pukiwiki.php on line 92

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/class/PukiWikiRender.php on line 70

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/class/PukiWikiElement.php on line 181

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/class/PukiWikiElement.php on line 538

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/class/PukiWikiElement.php on line 695

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/class/PukiWikiElement.php on line 1087

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112
rails3のvalidationコンテキスト指定はsaveでね。 | おれせか
おれせか

なんかそれっぽいのをうにうに。

kennyjのブログ(仮): rails3.0の頃からvalidationにコンテキストを指定できる様になってた

↑の記事を読んで、おおこりゃいいやと思いつつ使ってみた時に気づいたことメモ。

@hoge.update_attributes(params[:hoge], context: :foo)

何も考えずにupdate_attributesにも:contextオプション指定できるかなー?と思ってやってみた。
→ :updateコンテキスト(デフォ)扱いされる。

@hoge.attributes = params[:hoge]
@hoge.save(context: :foo)

attributes= してからsaveしてみた。
→ やったー。:fooコンテキスト扱いされたよー。

railsのdocumentちろっと見てみたらupdate_attributesの引数は1個しかないみたいなんで当たり前っちゃ当たり前なんですが、なんかrailsだとこのくらいサクっといけてしまうんじゃなかろうかて気がしたのでやってみたというね。

PAGETOP
PAGETOP

Prev / Next in same category

PAGETOP

Comments (10)

For Very best 1 Shopping bags, people observe careful principles for superior, so its possible to move forward knowing the end system could replicate similar superior skillfullness as the actual LV container.
ありませ

[2013/04/25 (木) 13:02]

我々は、よりエキサイティングな記事を楽しみにしています。

[2013/05/06 (月) 10:26]

はありません。

[2013/05/08 (水) 15:54]

ちろっと見てみたらupdate_attributesの引数は1個しかないみたいなんで当たり前っちゃ当たり前なんですが、なんかrailsだとこのくらいサクっといけてしまうんじゃなかろうかて気がしたのでやってみたというね。

[2014/02/19 (水) 13:19]

良い書き込み記事をありがとう!それは実際にはアミューズメントアカウントです。

[2015/09/16 (水) 13:01]

キーケース、靴、サングラ、指輪、ネックレス、手帳、小物、SS品、N品、価格、品質の保証
ヴィトンバッグコピー
ヴィトン財布コピー
ヴィトン靴コピー
ヴィトンベルトコピー
ヴィトンネクタイ
ヴィトン腕時計
近来ヴィトン偽物のベルトのデザイナーの変化、

直接出産を促して紳士のベルトの出現と発展、
デザインが多くないが、
しかし依然として流行する界ヴィトン偽物の潮流と方向に引率しているので
ヴィトン偽物LOUIS VUITTONカーフベルトbe3103高貴精品シルバー金具
ヴィトンコピーhttp://www.lijka.com/

[2015/11/07 (土) 23:47]

良い書き込み記事をありがとう!それは実際にはアミューズメントアカウントです。

[2015/11/23 (月) 17:46]

railsのdocumentちろっと見てみたらupdate_attributesの引数は1個しかないみたいなんで当たり前っちゃ当たり前なんですが、なんかrailsだとこのくらいサクっといけてしまうんじゃなかろうかて気がしたのでやってみたというね。

[2016/01/06 (水) 17:47]

一方、優れたスーパーコピー素材で作りますから、質感が素晴らしいです

[2016/01/15 (金) 17:41]

↑の記事を読んで、おおこりゃいいやと思いつつ使ってみた時に気づいたことメモ。

[2016/03/31 (木) 09:55]
PAGETOP

Comment Form

PAGETOP

Trackbacks (2)

ugg.rawrevol.com

rails3のvalidationコンテキスト指定はsaveでね。 | おれせか

[2014/09/23 (火) 21:40]

UGG ブーツ ニット

rails3のvalidationコンテキスト指定はsaveでね。 | おれせか

[2014/10/07 (火) 14:50]
PAGETOP

Trackback URL

PAGETOP

Search