Skip to content

Instantly share code, notes, and snippets.

@killthekitten
Created July 23, 2013 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save killthekitten/6064211 to your computer and use it in GitHub Desktop.
Save killthekitten/6064211 to your computer and use it in GitHub Desktop.
class TariffSchemeFeeRule < ActiveRecord::Base
belongs_to :tariff_scheme
belongs_to :fee_rule
belongs_to :currency
validates :currency_id, uniqueness: { scope: [:fee_rule_id, :tariff_scheme_id] }, presence: true
end
class TariffScheme < ActiveRecord::Base
accepts_nested_attributes_for :tariff_scheme_fee_rules, allow_destroy: true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment