Skip to content

Instantly share code, notes, and snippets.

@Peeja
Created August 17, 2009 21:23
Show Gist options
  • Save Peeja/169389 to your computer and use it in GitHub Desktop.
Save Peeja/169389 to your computer and use it in GitHub Desktop.
named_scope :valid_for_state_and_user, lambda { |state, user| lambda { |transition|
transition.from_state_id == state.id &&
!transition.protected? or user.role.can_apply_protected_note_transitions?
}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment