Displaying 2 results from an estimated 2 matches for "build_model".
Did you mean:
build_mode
2012 Aug 17
3
Rails doesn't validate create_model or build_model (has_one association)
I''ve got User has_one Shop. Rails is not validating when I tried
create_shop or build_shop, neither in the browser nor the rails console.
My code:
class Shop < ActiveRecord::Base
attr_protected :user_id
belongs_to :user
validates_presence_of :name, :primary_address, :city, :country_code,
:currency
end
class ShopsController < ApplicationController
before_filter
2009 Feb 09
3
RSpec Testing ActiveRecord config dependency.
...to test that I get the expected results with the config set to
utc and otherwise. The library code is used to automatically set a
model attribute on create. My existing specification looks somewhat
like this:
describe "Builds a Model with custom magic columns" do
before(:all) do
build_model :magiks do
string :description
# these are Rails'' own magic columns
...
# these are our custom magic columns
...
end
@my_mage = Magik.new
@my_mage.save!
end
it "should set each custom magic column present" do
(Magik.column_names & Activ...