[Rails] [Help] Need help with first_or_create. Never finds existing Record

2015-10-30 Thread Chris Maher
I have a problem with a form that either updates or creates depending on whether the "project" exists already. Im using the def create def create puts params.inspect @project = current_user.projects.where(id: params[:id]).first_or_create(project_params) puts params.inspect if @pro

[Rails] [ANN] Rails 4.2.5.rc1 and 4.1.14.rc1 have been released!

2015-10-30 Thread Rafael Mendonça França
Hi everyone, I am happy to announce that Rails 4.2.5.rc1 and 4.1.14.rc1 have been released. If no regressions are found expect the final release this Wednesday, on November 4, 2015. If you find one, please open an [issue on GitHub]( https://github.com/rails/rails/issues/new) and mention me (@rafa

[Rails] meta modeling in ActiveRecord/ Rails

2015-10-30 Thread mark
Hi, I am trying to create a design for user defined tables which could be stored in a database then initialized from a controller as needed. At present I am having a bit of trouble getting these metamodels into the rails env from a controller. Is there a way that I can class_eval a model that

[Rails] Re: Active Record has_one through

2015-10-30 Thread Travis Eubanks
why dont you just do this class Artist < ActiveRecord::Base has_many :events, dependent: :destroy end class Event < ActiveRecord::Base belongs_to :artist end a = Artist.first a.events which will return a list of events connected to that artist e = Event.first e.artist which will return

[Rails] Re: .gemrc containing "gem: --no-ri --no-rdoc"

2015-10-30 Thread fugee ohu
Thanks Colin On Thursday, October 29, 2015 at 12:54:33 PM UTC-4, fugee ohu wrote: > > I put a .gemrc file in my home directory, the same directory my Gemfile is > in, with just "gem: --no-ri --no-rdoc" but when i install gems the docs > still get installed, causing me to have to wait > -- You