[Rails] Advanced ActiveRecord tutorials

2014-02-24 Thread Ganesh Ranganathan
Any recommendations for good advanced tutorials on ActiveRecord in Rails4? I'm interested in joins, group, counts especially for deep associations. Thanks, Ganesh -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this

Re: [Rails] Refresh token using Omniauth-oauth2 in Rails application?

2014-02-24 Thread Ganesh Ranganathan
On Fri, Feb 14, 2014 at 9:03 PM, Jordon Bedwell envyge...@gmail.com wrote: Last I remember omniauth does not support this at all. No, a helper is not the best place to do it, you should probably either background check the token and refresh it there or add it as a method to the user model

[Rails] harmony gem issue

2014-02-24 Thread saravanan p
Hello everyone, saravanan@ubuntu:~$ ruby -v ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux] saravanan@ubuntu:~$ rails -v Rails 4.0.3 saravanan@ubuntu:~$ rvm -v rvm 1.24.4 (stable) by Wayne E. Seguin wayneeseg...@gmail.com, Michal Papis mpa...@gmail.com [https://rvm.io/] *I am trying

[Rails] Newbie friendly open source project?

2014-02-24 Thread lala
Hello, I'm a hobby programmer learning Rails and I love it! I've done a few of my own RoR projects and now I would like to start participating in open source for the first time in my life. I am terrified of doing my first ever pull request. Could anyone please recommend an open source project

[Rails] Please help to DRY snippet

2014-02-24 Thread Роман Ярыгин
Hello. Please, help me to DRY this code snippet. The task is to print div content, but to print it in div, when i%17 ==0 and make it without div, when not. I guess that it maybe proc or lambda will help, but I never used it before. Or maybe it is some simpler method? #splitter -

[Rails] Full-stack Ruby on Rails Programmer for Swiss startup

2014-02-24 Thread David Leza
RECOMY is a Swiss startup aiming to change the job/recruiting market. We are looking for a talented RoR developer who is willing to take the leap and join us in developing something truly remarkable. Your profile: - You are highly motivated to join a startup with all the risks and benefits this

Re: [Rails] Please help to DRY snippet

2014-02-24 Thread Dave Aronson
On Mon, Feb 24, 2014 at 7:35 AM, Роман Ярыгин 330...@gmail.com wrote: Please, help me to DRY this code snippet. The task is to print div content, but to print it in div, when i%17 ==0 and make it without div, when not. A view helper method would do the trick. Make one that returns the bit

[Rails] Custom order of Hash

2014-02-24 Thread Artem Kalinchuk
Would a custom order of a hash be useful in Rails? If I have the following Hash: my_hash = { key1: 'value', key2: 'value', key3: 'value' } And I want to order it by the following keys: my_hash = my_hash.order(:key2, :key1, :key3) I would get a new hash with the following result: puts

Re: [Rails] Custom order of Hash

2014-02-24 Thread Gautam Rege
Having an OrderedHash that saves insertion order is useful enough and I personally don't see a reason for a custom ordered hash. Wouldn't it be less expensive to order only the keys in a separate array and access the hash rather than creating a new hash? My 2 cents. -- @gautamrege

Re: [Rails] Custom order of Hash

2014-02-24 Thread Scott Ribe
On Feb 24, 2014, at 8:28 AM, Artem Kalinchuk art...@gmail.com wrote: Any thoughts? Hashes are by definition unordered. If you think you need an ordered hash, then you probably don't understand hashes... -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567

[Rails] Jim Weirich's final GitHub commit

2014-02-24 Thread Ganesh Ranganathan
https://github.com/jimweirich/wyriki/commit/d28fac7f18aeacb00d8ad3460a0a5a901617c2d4 Nice of Github to put up a banner in his honour. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails

Re: [Rails] Custom order of Hash

2014-02-24 Thread Gautam Rege
Hashes are by definition unordered. If you think you need an ordered hash, then you probably don't understand hashes... Ruby 1.9 onwards saves the insertion order of hashes. In fact in Ruby 2.1 - a hash of under 6 elements is stored as an array ;) 2.1.0 :001 hsh = {'a' = 1, 'b' = 2, 'c' =

Re: [Rails] Custom order of Hash

2014-02-24 Thread Artem Kalinchuk
There is a reason why we have ordered hashes... On Monday, February 24, 2014 11:53:04 AM UTC-5, Scott Ribe wrote: On Feb 24, 2014, at 8:28 AM, Artem Kalinchuk art...@gmail.comjavascript: wrote: Any thoughts? Hashes are by definition unordered. If you think you need an ordered hash,

Re: [Rails] Custom order of Hash

2014-02-24 Thread Artem Kalinchuk
Honestly, I've needed it many times and was surprised that it wasn't implemented yet. Of course, there are a few ways you can do this (probably more efficient way than what I suggested) but we also need to keep in mind that we should keep our code as DRY as possible. On Monday, February 24,

Re: [Rails] Re: Best IDEs for Ruby on Rails

2014-02-24 Thread Ricardo do Valle
Vim + a lot of configs and plugins: https://github.com/skwp/dotfiles Rubymine is very good to start, but it is heavy. On Sun, Feb 23, 2014 at 11:18 PM, Filipe Chagas froccha...@gmail.comwrote: Tmux + Vim + Some plugins - It's better than any IDE. Em sexta-feira, 21 de fevereiro de 2014

[Rails] Optimize query to use sql over ruby iterators

2014-02-24 Thread John Merlino
I have the following setup: class Unit has_many :reports end class Report belongs_to :unit end Basically I have a list of units and I want to select the last report for each unit (based on time) and order the resulting last reports by longitude. Sounds simple, but my implementation looks

[Rails] Re: ExecJS::RuntimeError in Say#hello

2014-02-24 Thread jim
It looks like this may help http://stackoverflow.com/a/14118913 Jim On Sunday, February 23, 2014 5:38:04 AM UTC-5, Askhat Bolatkhan wrote: Showing *D:/RailsInstaller/blog/app/views/layouts/application.html.erb* where line *#6* raised: module.js:340 throw err; ^ Error:

[Rails] Re: fails ruby-ldap on ubuntu 10.04

2014-02-24 Thread Keith Mascarenhas
Hi, I had the same error. The ruby-ldap gem required a library called libldap2-dev to work. Try sudo apt-get install libldap2-dev and then try installing the gem again. On Friday, October 15, 2010 1:13:16 AM UTC-4, Ruby-Forum.com User wrote: Hi, I tried to install ruby-ldap 0.9.9 on

[Rails] JOBS - Cambridge, MA Start Up seeks experienced Ruby Developer

2014-02-24 Thread Kathleen Gilroy
We are looking for an experience Ruby developer to work on our new location services platform. This is a full time and/or project position depending upon your availability and interest. We are rewriting our mobile event platform to support location services. We have a contract to deploy the

[Rails] Looking for RoR Partner for New StartupLeap project

2014-02-24 Thread Algirdas Matijosaitis
https://lh5.googleusercontent.com/-eaYmtnb6JoU/UwwhlaUvApI/Adw/jHxCTS0_UMU/s1600/sl+logo.png About Project StartupLeap is the network for you to prepare your Startups for Crowdfunding or Angel funding. Build hype and buzz around your Startup when you connect with other users and

[Rails] Re: Best IDEs for Ruby on Rails

2014-02-24 Thread Yin Wang
That's true. I used RubyMine to develop the Ruby part in my project and it was much more helpful than editors and command line. I developed program analysis tools for languages, so I know how much more advanced are IDEs compared to text editors. They are qualitatively different. JetBrains does

[Rails] Best Way To Manage Mutable Public Rails Return Types

2014-02-24 Thread Matt Glover
Our team ran into a problem in a Rails application today where someone unknowingly modified Rails internals leading to bad query generation. The developer modified the list of attribute names for a model by reading and then mutating the contents of

[Rails] Re: Best IDEs for Ruby on Rails

2014-02-24 Thread Yin Wang
We are developing tools for ruby and rails and released a plugin for sublime for searching symbols: https://github.com/sourcegraph/sourcegraph-sublime It's based on a global index we are building for open source ruby code so that you can accurately search for examples of a particular class,