Displaying 2 results from an estimated 2 matches for "tracking_code".
2013 May 07
3
validates :uniqueness apparently doesn't
.... All validations on other attributes behave as expected.
I''ve done what I could to search the Rails docs, Google, Stack Overflow,
and this forum for similar problems, and found nothing.
What''s wrong?
=====
All code is excerpted.
Fixture:
active_1:
name: Thomas Jefferson
tracking_code: tj_001_TC01
...
Class declaration:
class Family < ActiveRecord::Base
attr_accessible ... :tracking_code
validates :tracking_code, :presence => true, :length => { :maximum =>
20, :minimum => 8 }, :uniqueness => true
Test case:
setup do
@copy = families(:active_1).dup...
2006 Dec 07
2
Problem saving parent and children using belongs_to, class_name, and foreign_key
Hi, I have a real simple association setup here that''s just trying to:
- Create a new PayjunctionOrder
- Create some LineItem objects and assign them to the PayjunctionOrder
- Save everything
I''m using Rails Edge.
----
class PayjunctionOrder < ActiveRecord::Base
has_many :line_items
end
------------------
----
class LineItem < ActiveRecord::Base
belongs_to :order,