Class: PlantWatchdog::Model::User

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/plantwatchdog/model.rb

Instance Method Summary collapse

Instance Method Details

#data_updated(time_year) ⇒ Object



147
148
149
150
151
152
153
154
155
# File 'lib/plantwatchdog/model.rb', line 147

def data_updated time_year
  new_start_year = time_year if start_year.nil?  or time_year < start_year
  new_end_year = time_year if end_year.nil? or time_year > end_year
  if (new_start_year or new_end_year)
    self.start_year = new_start_year if new_start_year
    self.end_year = new_end_year if new_end_year
    p save
  end
end