diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/models/location.rb | 4 | ||||
| -rw-r--r-- | app/models/user.rb | 16 | ||||
| -rw-r--r-- | app/models/well_type.rb | 10 |
3 files changed, 28 insertions, 2 deletions
diff --git a/app/models/location.rb b/app/models/location.rb new file mode 100644 index 0000000..611ae87 --- /dev/null +++ b/app/models/location.rb @@ -0,0 +1,4 @@ +class Location + def initialize(latitude: 0, longitude: 0, township: 'unknown') + end +end diff --git a/app/models/user.rb b/app/models/user.rb new file mode 100644 index 0000000..7085ac2 --- /dev/null +++ b/app/models/user.rb @@ -0,0 +1,16 @@ +class User + attr_reader :company + + def initialize(company: nil) + @company = company + end + + def apply_for(well_type, location) + license = License.new + license.company = company + license.well_type = well_type + license.location = location + license.applicant = self + license + end +end diff --git a/app/models/well_type.rb b/app/models/well_type.rb index 5367ce2..361dd99 100644 --- a/app/models/well_type.rb +++ b/app/models/well_type.rb @@ -1,3 +1,9 @@ -class WellType - ALL=[] +class WellType < ActiveRecord::Base + NFW=WellType.find_by_id(1) + NPW=WellType.find_by_id(2) + DPT=WellType.find_by_id(3) + SPT=WellType.find_by_id(4) + DEV=WellType.find_by_id(5) + + ALL=[NFW, NPW, DPT, SPT, DEV] end |
