summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2014-02-22 13:03:45 -0700
committermo khan <mo@mokhan.ca>2014-02-22 13:03:45 -0700
commitd363dc6298e8210fb3a5eddea8a6916a54005290 (patch)
treed722fbe64f53cfa4f05312e7444f007bb30c15f2 /app/models
parentd62b19c584862b3c54559348475a93fffd985e7f (diff)
switch from has_one to belongs_to relationship.
Diffstat (limited to 'app/models')
-rw-r--r--app/models/license.rb2
-rw-r--r--app/models/location.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/license.rb b/app/models/license.rb
index 12bb387..b7e1dff 100644
--- a/app/models/license.rb
+++ b/app/models/license.rb
@@ -1,7 +1,7 @@
class License < ActiveRecord::Base
belongs_to :company
belongs_to :well_type
- has_one :location
+ belongs_to :location
belongs_to :applicant, class_name: 'User', foreign_key: 'user_id'
def status
diff --git a/app/models/location.rb b/app/models/location.rb
index b74eabc..5587398 100644
--- a/app/models/location.rb
+++ b/app/models/location.rb
@@ -1,3 +1,3 @@
class Location < ActiveRecord::Base
- belongs_to :license, autosave: true
+ has_one :license, autosave: true
end