{"categories":["Rails","Ruby"],"provider_name":"Hatena Blog","blog_title":"miyohide's blog","provider_url":"https://hatena.blog","height":"190","author_name":"miyohide","version":"1.0","width":"100%","published":"2012-05-29 23:34:37","title":"audited\u3092\u4f7f\u3063\u3066\u30e2\u30c7\u30eb\u306e\u5909\u66f4\u3092\u76e3\u8996\u3057\u3088\u3046\uff08\u95a2\u9023\u7de8\uff09","url":"https://miyohide.hatenablog.com/entry/20120529/1338302077","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmiyohide.hatenablog.com%2Fentry%2F20120529%2F1338302077\" title=\"audited\u3092\u4f7f\u3063\u3066\u30e2\u30c7\u30eb\u306e\u5909\u66f4\u3092\u76e3\u8996\u3057\u3088\u3046\uff08\u95a2\u9023\u7de8\uff09 - miyohide&#39;s blog\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_url":"https://blog.hatena.ne.jp/miyohide/","blog_url":"https://miyohide.hatenablog.com/","description":"\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u7de8\u3001\u9069\u7528\u7de8\u306b\u7d9a\u304f\u95a2\u9023\u7de8\u3067\u3059\u3002\u904e\u53bb2\u56de\u306f\u305d\u308c\u305e\u308c\u4ee5\u4e0b\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u7de8 \u95a2\u9023\u7de8 User\u30e2\u30c7\u30eb\u3068Company\u30e2\u30c7\u30eb\u306b\u306f\u6b21\u306e\u3088\u3046\u306a\u95a2\u9023\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u308b\u3068\u3057\u307e\u3059\u3002\u307e\u305a\u306fapp/models/user.rb\u3002 class User < ActiveRecord::Base audited belongs_to :company end \u6b21\u306b\u3001app/models/company.rb\u3002 class Company < ActiveRecord::Base has_many :users end \u3053\u306e\u3068\u304d\u306bCompany\u7d4c\u7531\u3067User\u3092\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u304cRails\u306e\u3059\u3054\u3044\u2026","image_url":null,"type":"rich"}