RailsCasts Pro episodes are now free!

Learn more or hide this

paolotax's Profile

GitHub User: paolotax

Comments by paolotax

Avatar

Any idea on how to implement with postgresql

ruby
def self.with_last_state(state)
  order("id desc").group("order_id").having(state: state)
end

and the relative scope in Order model