lib/doorkeeper/models/scopes.rb in doorkeeper-0.4.2 vs lib/doorkeeper/models/scopes.rb in doorkeeper-0.5.0.rc1

- old
+ new

@@ -1,13 +1,17 @@ module Doorkeeper module Models module Scopes - def scopes - Doorkeeper::OAuth::Scopes.from_string(self[:scopes]) - end + def self.included(base) + base.class_eval do + define_method :scopes do + Doorkeeper::OAuth::Scopes.from_string(self[:scopes]) + end - def scopes_string - Doorkeeper::OAuth::Scopes.from_string(self[:scopes]).to_s + define_method :scopes_string do + Doorkeeper::OAuth::Scopes.from_string(self[:scopes]).to_s + end + end end end end end