gem install rails --pre
rails new my_app -T
# ActiveRecord::Base#dup and ActiveRecord::Base#clone semantics have changed to closer match normal Ruby dup and clone semantics. | |
# Calling ActiveRecord::Base#clone will result in a shallow copy of the record, including copying the frozen state. No callbacks will be called. | |
# Calling ActiveRecord::Base#dup will duplicate the record, including calling after initialize hooks. Frozen state will not be copied, and all associations will be cleared. A duped record will return true for new_record?, have a nil id field, and is saveable. |
require 'test_helper' | |
require 'minitest/autorun' | |
module Tenderlove | |
class Spec < MiniTest::Spec | |
include ActiveSupport::Testing::SetupAndTeardown | |
include ActiveRecord::TestFixtures | |
alias :method_name :__name__ if defined? :__name__ | |
self.fixture_path = File.join(Rails.root, 'test', 'fixtures') |
class Utf8Header < Thor | |
desc "add", "Add Content UTF-8 on top of all .rb/.feature files" | |
# copy & pasted from https://gist.github.com/738245 | |
def add | |
files = Array.new | |
["*.rb", "*.rake","*.feature"].each do |extension| | |
files.concat(Dir[ File.join(Dir.getwd.split(/\\/), "**", extension) ]) | |
end | |
files.each do |file| |
set nocompatible | |
set number | |
set ruler | |
syntax on | |
" Whitespace stuff | |
set nowrap | |
set tabstop=2 | |
set shiftwidth=2 |
##Enlight Solutions Seeks a Rubyist That Wants to Learn##
Are you looking for a part time ruby gig (15-20 hours / week)? Come learn and grow with Enlight Solutions. It's a great opportunity to improve your coding skills and create awesome applications. This could eventually turn out to be a full time, salaried position.
If you're interested, please send me your github account, references, hourly rate, and/or code samples (in lieu of a github account). Resumes are great, but practical application and endorsements from your peers or clients will secure the position.
###You will:###
ouvasam # Hello Using ripple is there something to delete an embedded document | |
seancribbs # ouvasm: one or many? | |
ouvasam # many | |
]seancribbs # the association proxies an array, so you should be able | |
to do doc.embedded_docs.delete(embedded_doc) | |
ouvasam # thanks, but using a html form, how can i retrieve the embedded doc ? |
# user.rb | |
class User < ActiveRecord::Base | |
belongs_to :address | |
accepts_nested_attributes_for :address # can't have allow_destroy | |
end | |
# users_controller.rb | |
class UsersController < ApplicationController |
# get current jruby | |
wget http://jruby.kenai.com/downloads/1.4.0/jruby-bin-1.4.0.tar.gz | |
tar xzvf jruby-bin-1.4.0.tar.gz | |
sudo mv jruby-1.4.0/ /opt | |
# link executables in /usr/local/bin | |
sudo ln -s /opt/jruby-1.4.0/bin/{jgem,jirb,jruby} /usr/local/bin |