Advertisement
VladikOtez

make_current method

Jun 2nd, 2017
1,264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.16 KB | None | 0 0
  1. def make_current!
  2.     @decks = Deck.where(current: true) #AR::Relation ??
  3.     @decks.map! {|deck| deck.current = false}
  4.     self.current = true
  5.     save
  6.   end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement