Browse files

Introducing Price

  • Loading branch information...
1 parent 6b24ded commit 12a5cbfcef758437c063b294d2a0bdb68a1c85ad @DanielVartanov committed Jan 14, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/price.rb
View
8 lib/price.rb
@@ -0,0 +1,8 @@
+class Price < ActiveRecord::Base
+ belongs_to :from, :class_name => "Zone"
+ belongs_to :to, :class_name => "Zone"
+
+ def self.between(from, to)
+ where(:from_id => from.id, :to_id => to.id).first
+ end
+end

0 comments on commit 12a5cbf

Please sign in to comment.