Class: SimpleItem

Inherits:
Item
  • Object
show all
Defined in:
app/models/simple_item.rb

Direct Known Subclasses

Expense, Income

Class Method Summary collapse

Methods inherited from Item

#before_validation, #validate

Class Method Details

.find_conflict(item) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'app/models/simple_item.rb', line 10

def self.find_conflict(item)
  Item.all(:conditions => {
    :type => item.type,
    :date => item.date, 
    :account_id => item.,
    :category_id => item.category_id,
    :position => item.position,
  }).reject{|x| x.id == item.id}.first
end