lib/tokenize.rb in jt-rails-tokenizable-1.0.8 vs lib/tokenize.rb in jt-rails-tokenizable-1.0.9
- old
+ new
@@ -3,21 +3,21 @@
included do
before_validation :jt_rails_generate_tokens, on: :create
end
- module ClassMethods
+ class_methods do
def tokenize(field, options = {})
jt_rails_token_fields[field.to_sym] = options
if options.fetch(:valiations, true)
validates field, presence: true, uniqueness: true
end
end
def jt_rails_token_fields
- @@jt_rails_token_fields ||= {}
+ @jt_rails_token_fields ||= {}
end
end
def jt_rails_generate_tokens