summaryrefslogtreecommitdiff
path: root/bin/sample.rb
diff options
context:
space:
mode:
Diffstat (limited to 'bin/sample.rb')
-rwxr-xr-xbin/sample.rb41
1 files changed, 41 insertions, 0 deletions
diff --git a/bin/sample.rb b/bin/sample.rb
new file mode 100755
index 0000000..5297ff4
--- /dev/null
+++ b/bin/sample.rb
@@ -0,0 +1,41 @@
+#!/usr/bin/env ruby
+require ::File.expand_path('../../config/environment', __FILE__)
+
+ActiveRecord::Base.transaction do
+ abc_resources = Company.create(id: '680fc2c1-9557-49fd-b05f-0f700a67ca0c', name: 'ABC Resources Ltd.')
+ xyz_resources = Company.create(id: '04e6b076-41ca-4849-8a94-14e4e505ffe8', name: 'XYZ Resources Ltd.')
+
+ jd = User.create(first_name: 'john', last_name: 'dielwart', company: abc_resources)
+ hal = User.create(first_name: 'hal', last_name: 'kvisle', company: xyz_resources)
+
+ township_1 = Location.create(latitude: 51.06, longitude: -114.09, township: '1')
+ township_2 = Location.create(latitude: 40.06, longitude: -100.09, township: '2')
+ township_3 = Location.create(latitude: 30.06, longitude: -90.01, township: '3')
+
+ public_license = abc_resources.licenses.create(
+ id: 'e4650fd2-2298-463a-bfcd-fb953d996d6e',
+ well_type: WellType::NFW,
+ location: township_1,
+ applicant: jd,
+ issued_at: 1.day.ago,
+ expired_at: 1.year.from_now
+ )
+
+ public_expired_license = abc_resources.licenses.create(
+ id: '20d69330-ebc9-40b6-9d25-0174aea3c056',
+ well_type: WellType::DPT,
+ location: township_3,
+ applicant: jd,
+ issued_at: 1.year.ago,
+ expired_at: 1.day.ago
+ )
+
+ confidential_license = xyz_resources.licenses.create(
+ id: 'fd3918dd-6296-49ce-83bb-c518916fb82e',
+ well_type: WellType::SPT,
+ location: township_2,
+ applicant: hal,
+ issued_at: 1.day.ago,
+ expired_at: 1.year.from_now
+ )
+end