<?xml version="1.0" encoding="UTF-8"?>
<post>
  <body>&#1048;&#1079;&#1087;&#1086;&#1083;&#1079;&#1074;&#1072;&#1085;&#1077; &#1085;&#1072; &#1082;&#1086;&#1085;&#1089;&#1090;&#1072;&#1085;&#1090;&#1072;/string &#1082;&#1072;&#1090;&#1086; &#1080;&#1084;&#1077; &#1085;&#1072; &#1084;&#1086;&#1076;&#1077;&#1083;:

Hash &#1089; &#1082;&#1086;&#1085;&#1089;&#1090;&#1072;&#1085;&#1090;&#1080;:
&lt;code&gt;
    rtypes = {
      ...
      "rapps"=&gt;"RentApp",
      "sapps"=&gt;"SaleApp",
      ...   
    }
&lt;/code&gt;
&#1048;&#1079;&#1087;&#1086;&#1083;&#1079;&#1074;&#1072;&#1085;&#1077; &#1082;&#1072;&#1090;&#1086; &#1080;&#1084;&#1077;&#1085;&#1072; &#1085;&#1072; &#1084;&#1086;&#1076;&#1077;&#1083;&#1080;:
&lt;code&gt;
 rtypes.each_pair {|offer_type, model|
   offers = model.constantize.find :all
   ...
 }
&lt;/code&gt;
&#1050;&#1086;&#1085;&#1089;&#1090;&#1072;&#1085;&#1090;&#1072;&#1090;&#1072; &#1084;&#1086;&#1078;&#1077; &#1080; &#1076;&#1072; &#1085;&#1077; &#1077; &#1089; &#1090;&#1086;&#1095;&#1085;&#1086;&#1090;&#1086; &#1080;&#1084;&#1077; &#1085;&#1072; &#1084;&#1086;&#1076;&#1077;&#1083;&#1072;. &#1053;&#1072;&#1087;&#1088;&#1080;&#1084;&#1077;&#1088; SaleApp &#1084;&#1086;&#1078;&#1077; &#1076;&#1072; &#1073;&#1098;&#1076;&#1077; sale_app, &#1090;&#1086;&#1075;&#1072;&#1074;&#1072; &#1089;&#1090;&#1072;&#1074;&#1072; &#1090;&#1072;&#1082;&#1072;:
&lt;code&gt;
 offers = model.classify.constantize.find :all
&lt;/code&gt;
</body>
  <created-at type="datetime">2009-04-02T18:14:26+03:00</created-at>
  <id type="integer">9</id>
  <permalink>&#1080;&#1079;&#1087;&#1086;&#1083;&#1079;&#1074;&#1072;&#1085;&#1077;-&#1085;&#1072;-&#1082;&#1086;&#1085;&#1089;&#1090;&#1072;&#1085;&#1090;&#1072;-&#1082;&#1072;&#1090;&#1086;-&#1080;&#1084;&#1077;-&#1085;&#1072;-&#1084;&#1086;&#1076;&#1077;&#1083;</permalink>
  <private type="boolean">false</private>
  <title>&#1048;&#1079;&#1087;&#1086;&#1083;&#1079;&#1074;&#1072;&#1085;&#1077; &#1085;&#1072; &#1082;&#1086;&#1085;&#1089;&#1090;&#1072;&#1085;&#1090;&#1072;, &#1082;&#1072;&#1090;&#1086; &#1080;&#1084;&#1077; &#1085;&#1072; &#1084;&#1086;&#1076;&#1077;&#1083;</title>
  <updated-at type="datetime">2009-04-02T18:15:13+03:00</updated-at>
  <user-id type="integer">2</user-id>
</post>
