{"id":3382,"date":"2013-10-21T13:12:50","date_gmt":"2013-10-21T04:12:50","guid":{"rendered":"http:\/\/www.techscore.com\/blog\/?p=3382"},"modified":"2018-11-14T16:33:53","modified_gmt":"2018-11-14T07:33:53","slug":"easy_model-%e3%81%a7%e4%bb%a3%e5%85%a5%e6%99%82%e3%81%ab%e5%9e%8b%e5%a4%89%e6%8f%9b%e3%81%95%e3%82%8c%e3%82%8b%e5%b1%9e%e6%80%a7%e3%82%92%e5%ae%9a%e7%be%a9%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.techscore.com\/blog\/2013\/10\/21\/easy_model-%e3%81%a7%e4%bb%a3%e5%85%a5%e6%99%82%e3%81%ab%e5%9e%8b%e5%a4%89%e6%8f%9b%e3%81%95%e3%82%8c%e3%82%8b%e5%b1%9e%e6%80%a7%e3%82%92%e5%ae%9a%e7%be%a9%e3%81%99%e3%82%8b\/","title":{"rendered":"easy_model \u3067\u4ee3\u5165\u6642\u306b\u578b\u5909\u63db\u3055\u308c\u308b\u5c5e\u6027\u3092\u5b9a\u7fa9\u3059\u308b"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u9234\u6728\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>Rails \u7528\u306e easy_model \u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f5c\u6210\u3057\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u5148\u65e5 Rails4 \u5bfe\u5fdc\u7248\u306e\u30d0\u30fc\u30b8\u30e7\u30f3 2.x \u7cfb\u7d71\u3092\u30ea\u30ea\u30fc\u30b9\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u7d39\u4ecb\u8a18\u4e8b\u3092\u66f8\u3053\u3046\u3068\u601d\u3044\u3064\u3064\u3001\u4eca\u306b\u81f3\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002\uff08\uff3e\uff3e\uff1b<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/techscore\/easy_model\/\">GitHub (easy_model)<\/a><\/li>\n<li><a href=\"http:\/\/rubygems.org\/gems\/easy_model\/\">RubyGems.org (easy_model)<\/a><\/li>\n<\/ul>\n<p>\u4f7f\u3044\u65b9\u306f README \u306b\u307e\u3068\u3081\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/techscore\/easy_model\/blob\/master\/README_ja.rdoc\">GitHub (easy_model\/README_ja.rdoc)<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>easy_model \u306f\u4ee3\u5165\u6642\u306b\u578b\u5909\u63db\u3055\u308c\u308b\u5c5e\u6027\u3092\u5b9a\u7fa9\u3059\u308b<\/h2>\n<p>easy_model \u3092\u4f7f\u3046\u3068\u3001\u4ee3\u5165\u6642\u306b\u578b\u5909\u63db\u3055\u308c\u308b\u5c5e\u6027\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3082\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3001ActiveRecord::Base \u3092\u7d99\u627f\u3057\u305f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u30c6\u30fc\u30d6\u30eb\u304c\u5b58\u5728\u3059\u308b\u30e2\u30c7\u30eb\u3068\u540c\u3058\u3088\u3046\u306a\u52d5\u304d\u3092\u3057\u307e\u3059\u3002<\/p>\n<p>easy_model \u3092\u4f7f\u7528\u3057\u305f\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true\"># \u30ed\u30b0\u30a4\u30f3\u30d5\u30a9\u30fc\u30e0.\r\nclass LoginForm\r\n\r\n  # easy_model \u3092\u4f7f\u3046\u306b\u306f EasyModel::Column \u3092 include \u3059\u308b.\r\n  include EasyModel::Column\r\n\r\n  # \u4f1a\u54e1\u756a\u53f7.\r\n  column :member_no, :integer\r\n\r\n  # \u30d1\u30b9\u30ef\u30fc\u30c9.\r\n  column :password, :string\r\n\r\n  # \u30ed\u30b0\u30a4\u30f3\u72b6\u614b\u3092\u4fdd\u6301\u3059\u308b.\r\n  column :remember, :boolan, default: false\r\n\r\nend<\/pre>\n<p>EasyModel::Column \u3092 include \u3057\u3066\u304b\u3089 column \u30e1\u30bd\u30c3\u30c9\u3067\u5c5e\u6027\u3092\u5b9a\u7fa9\u3059\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<p>column \u30e1\u30bd\u30c3\u30c9\u306f attr_accessor \u3092\u4fbf\u5229\u306b\u3057\u305f\u3082\u306e\u3068\u8003\u3048\u3066\u3044\u305f\u3060\u3051\u308c\u3070\u826f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>easy_model \u3092\u4f5c\u3063\u305f\u30ef\u30b1<\/h2>\n<p>Rails3 \u3067\u306f\u30e2\u30c7\u30eb\u306e\u6a5f\u80fd\u304c\u30e2\u30b8\u30e5\u30fc\u30eb\u5206\u5272\u3055\u308c\u3001\u30e2\u30c7\u30eb\u306e\u6a5f\u80fd\u304c\u518d\u5229\u7528\u53ef\u80fd\u306b\u306a\u3063\u305f\u3082\u306e\u306e\u3001<\/p>\n<ol>\n<li>\u518d\u5229\u7528\u3059\u308b\u305f\u3081\u306e\u304a\u6c7a\u307e\u308a\u306e\u30b3\u30fc\u30c9\u3092\u5927\u91cf\u306b\u66f8\u304b\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3002<\/li>\n<li>ActiveRecord \u306e\u3088\u3046\u306a\u578b\u5909\u63db\u6a5f\u80fd\u304c\u63d0\u4f9b\u3055\u308c\u3066\u3044\u306a\u3044\u3002<\/li>\n<li>ActiveRecord::Base \u3092\u7d99\u627f\u3057\u3066\u3044\u3066\u3082 attr_accessor \u3067\u5b9a\u7fa9\u3057\u305f\u5c5e\u6027\u3067\u306f\u4ee3\u5165\u6642\u306b\u578b\u5909\u63db\u3055\u308c\u306a\u3044\u3002<\/li>\n<\/ol>\n<p>\u3068\u3044\u3046\u554f\u984c\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u4ee5\u524d\u306f attr_accessor \u3067\u5c5e\u6027\u3092\u5b9a\u7fa9\u3057\u305f\u5f8c\u306b\u3001\u578b\u5909\u63db\u3092\u884c\u3046\u4ee3\u5165\u30e1\u30bd\u30c3\u30c9\u3092\u518d\u5b9a\u7fa9\u3057\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u6587\u5b57\u5217\u3057\u304b\u4ee3\u5165\u3055\u308c\u306a\u3044\u3068\u601d\u3044\u8fbc\u3093\u3067\u3057\u307e\u3044\u3001nil \u3084\u6587\u5b57\u5217\u4ee5\u5916\u304c\u4ee3\u5165\u3055\u308c\u3066\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3088\u3046\u306a\u30d0\u30b0\u3092\u5165\u308c\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u591a\u304f\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3053\u306e\u3088\u3046\u306a\u554f\u984c\u3092\u89e3\u6c7a\u3059\u308b\u305f\u3081\u306b easy_model \u304c\u751f\u307e\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067 easy_model \u306e\u7d39\u4ecb\u3067\u3057\u305f\u3002\u826f\u304b\u3063\u305f\u3089\u4f7f\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\uff08\uff3e\uff3e<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u9234\u6728\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>Rails \u7528\u306e easy_model \u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f5c\u6210\u3057\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u5148\u65e5 Rails4 \u5bfe\u5fdc\u7248\u306e\u30d0\u30fc\u30b8\u30e7\u30f3 2.x \u7cfb\u7d71\u3092\u30ea\u30ea\u30fc\u30b9\u3057\u307e\u3057\u305f\u3002<br \/><a href=\"https:\/\/www.techscore.com\/blog\/2013\/10\/21\/easy_model-%e3%81%a7%e4%bb%a3%e5%85%a5%e6%99%82%e3%81%ab%e5%9e%8b%e5%a4%89%e6%8f%9b%e3%81%95%e3%82%8c%e3%82%8b%e5%b1%9e%e6%80%a7%e3%82%92%e5%ae%9a%e7%be%a9%e3%81%99%e3%82%8b\/\">\u7d9a\u304d\u3092\u8aad\u3080...<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18],"tags":[22,24,70],"_links":{"self":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/3382"}],"collection":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/comments?post=3382"}],"version-history":[{"count":1,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/3382\/revisions"}],"predecessor-version":[{"id":17903,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/3382\/revisions\/17903"}],"wp:attachment":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/media?parent=3382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/categories?post=3382"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/tags?post=3382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}