Created
July 13, 2010 19:18
-
-
Save bhgames/474351 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
subscrpt.current_delivery_address = curraddr | |
subscrpt.subscrpt_type = SubscrptType.find(:first, :conditions => {:id => i.subscrpt_type_id}) | |
subscrpt.subscrpt_terms = SubscrptTerms.find(:first, :conditions => {:id => i.subscrpt_terms_id}) | |
subscrpt.save | |
@user.subscrpts<<subscrpt | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mysql::Error: Column 'current_delivery_address_id' cannot be null: INSERT INTO `subscrpt` (`current_delivery_address_id`, `processed`, `processed_by_provider`, `provider_id`, `subscrpt_status`, `subscrpt_terms_id`, `subscrpt_type_id`, `user_id`) VALUES (NULL, 0, 0, NULL, NULL, NULL, NULL, NULL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Subscrpt < ActiveRecord::Base | |
set_table_name "subscrpt" | |
set_primary_key "id" | |
has_one :current_delivery_address, :class_name => 'Address', :primary_key => :current_delivery_address_id | |
has_one :subscrpt_type | |
has_one :subscrpt_terms | |
has_one :provider | |
has_one :user | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment