yesterday i ran into an interesting problem which is im sure a silly
do models contain any logic?
for example in my class sale i have this function
if category == 0
Sale.find_by_sql(“Select * from Sales WHERE sale_id = ?”,
if category != 0
Sale.find_by_sql(“Select * from Sales”)
however this was not working when displaying data in my view. i tried
all variations of statements but no luck. When i put the if logic into
my controller and just created the same if statement in there, i had no
problem getting the data.
so i was thinking that if there is logic in a model class, than that
would take away from the controllers powers. is this true?