app/models/c80_estate/sevent.rb in c80_estate-0.1.0.34 vs app/models/c80_estate/sevent.rb in c80_estate-0.1.0.35

- old
+ new

@@ -8,22 +8,11 @@ has_many :pstats, :dependent => :destroy # нужен только при заполнении из rake db:seed:85_fill_sevents after_create :generate_pstat -=begin - def self.all_areas - self.all - end - - def self.free_areas - self.joins(:astatuses).where(:c80_estate_astatuses => { tag: 'free'}) - end - - def self.busy_areas - self.joins(:astatuses).where(:c80_estate_astatuses => { tag: 'busy'}) - end -=end + scope :created_at_asc, -> {order(:created_at => :asc)} + scope :created_at_desc, -> {order(:created_at => :desc)} def self.ecoef(area_id: nil, prop_id: nil, atype_id: nil, start_date: nil, end_date: nil) # start_date: строка вида 2015-12-12 result = {} \ No newline at end of file