[Rails] Device(?) works strange

2016-05-19 Thread Winterboum
1. I build http://SOME.example.com and http://OTHER.example.com on the server SOME.example.com. useing nginx unicorn RoR Device 2. For the clone, http://SOME_CLONE.example.com and http://OTHER_CLONE.example.com are builed on the server SOME_CLONE.example.com 3. Only SOME.example.com is

[Rails] Re: How to get similar elements from a array in Ruby.

2015-02-05 Thread Winterboum
is this fit for your purpose ? def my_select(array,str) array.select{ |sub_array| %r(#{str})=~ sub_array.join} end def another_select(array,str) array.select{ |sub_array| %r(#{str})=~ sub_array.first.to_s} end my_array = [[1,2],[11,2],[23,89]] while str = gets p

[Rails] Re: How can I? such as select max(peak_kw) peak,month from sola_daylies group by month;

2015-01-20 Thread Winterboum
Thank you, I got it. 2015年1月20日火曜日 5時55分31秒 UTC+9 Daniel Loureiro: Try this: Sola::Dayly.group(:month).maximum(:peak_kw) *Explanation:* find_by_sql is to be used to get real records, not database calculations. The Group, Max and other statements produce calculations, not real

[Rails] How can I? such as select max(peak_kw) peak,month from sola_daylies group by month;

2015-01-18 Thread Winterboum
When I tried on mysql select max(peak_kw) peak,month from sola_daylies group by month; It returns as I expected +++ | peak | month | +++ | 0.2126 | 2014-12-01 | | 1.6156 | 2015-01-01 | +++ on rails console,