Created
October 3, 2012 21:22
Revisions
-
raphaelcm created this gist
Oct 3, 2012 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ class PersistenceTest include Mongoid::Document include Mongoid::Timestamps BRAINTREE_SYNC_STATUSES = %w(new synced changed) # # Top-level Fields # field :terms_accepted_at, :type => DateTime field :first_billing_date, :type => Date field :next_billing_date, :type => Date field :trial_duration, :type => Integer, :default => 0 field :charge_attempts, :type => Integer, :default => 0 field :migrated_pmt, :type => String field :pre_coins_hub, :type => Boolean, :default => false field :braintree_billing, :type => Boolean, :default => true field :sync_status, :type => String, :default => "new" field :reminder_sent, :type => Boolean, :default => false field :override_amount, :type => Integer field :terms_accepted_at, :type => DateTime field :activated_at, :type => DateTime # # Validations # validates_inclusion_of :sync_status, :in => BRAINTREE_SYNC_STATUSES def created_in_braintree? self.sync_status != "new" end def synced? self.sync_status == "synced" end def changed? self.sync_status == "changed" end end