Sign in through GitHub

RailsCasts Pro episodes are now free!

Learn more or hide this

James Darryl's Profile

GitHub User: railscarma1

Site: http://railscarma.com/

Comments by James Darryl

Avatar

thanks this was the issue i was facing and took me one day to know about this
:D
https://www.carmatec.com
https://www.railscarma.com

Avatar

Nice to see how to implement Hstore in rails views. Thanks Ryan.
https://www.carmatec.com
https://www.railscarma.com

Avatar

+1 for destroyallsoftware

agree that is more complementing, though i would love to have more "true pro" episodes like this on railscasts!
https://www.carmatec.com
https://www.railscarma.com

Avatar

hanks for the episode. I followed along and everything worked as expected
https://www.carmatec.com
https://www.railscarma.com

Avatar

The best thing I've found to do is have a generator which generates your engine/gem's migrations directly into the local rails app, with a filename with timestamp based on time-of-generation-into-local-app, and only doing this generation if a migration with the same name (not counting timestamp) does not already exist in local app (so the generation step is idempotent, and can be run for later versions of engine/gem and only add new migrations, not duplicate ones already generated). but rails 3.1 i s now gone
...sad to see that

https://www.carmatec.com
https://www.railscarma.com

Avatar

thanks mamoht for this
I went a little farther into the Screencast to see if the code would eventually work. After failing on the very first import, I spit out a CSV file with the IDs, and all columns and with the following code, it works now.

def self.import(file)
CSV.foreach(file.path, headers: true) do |row|
document = find_by_id(row["id"]) || new
document.attributes = row.to_hash.slice(*accessible_attributes)
document.save!
end
end
thanks a lot
https://www.carmatec.com
https://www.railscarma.com

Avatar

Zeus, Spring, and Commands awesome things to speedup & test any application
https://www.carmatec.com
https://www.railscarma.com

Avatar

Thanks! I would really like to see more episodes on the "offline" subject.
https://www.carmatec.com
https://www.railscarma.com

Avatar

Thanks very much for this, Ryan - great timing considering the recent release of Phusion's new premium Passenger Enterprise product, which also allows for rolling restarts. It's good to learn that zero-downtime updates are also doable with 100% open source tools via Unicorn, albeit with increased memory requirements during restart.
https://www.railscarma.com https://www.carmatec.com

Avatar

Backbone and Rails is an awesome combination! Glad to see Backbone here on RailsCasts.

Another gem worth reviewing is backbone-rails.
https://www.carmatec.com https://www.railscarma.com

Avatar

as I understand it, when a web request comes in to a running web server, it will be handed off by Passenger (or whatever you use) to a running ruby process that has already handled a prior web request. Since the prior request most likely had a workflow that ran the before filter, and since the before filter sets the time zone for the entire process, that time zone is now being used for any code running in that process.
https://www.railscarma.com
https://www.carmatec.com

Avatar

Integration Tests are always going to be relatively slow, as you have to wait on the actual request/response cycles and page rendering, which is a lot more overhead. While there is some stuff you can do to dull the pain, practically you may want to stick to running javascripty tests on Travis or another CI if you aren't making active changes to the feature in question. (IE, run your focused tests, and let the CI build tell you if you broke something unintentionally)
ui developer @ RailsCarma & Carmatec

Avatar

If you want to run tests from within Sublime Text, check out the RailsCarma & Carmatec package. mcm replica