Module: ActiveRecordJsonUrlExtension

Extended by:
ActiveSupport::Concern
Defined in:
app/models/active_record_json_url_extension.rb

Defined Under Namespace

Classes: UrlHelper

Instance Method Summary collapse

Instance Method Details

#serializable_hash(options = {}) ⇒ Object



4
5
6
7
8
9
10
# File 'app/models/active_record_json_url_extension.rb', line 4

def serializable_hash(options = {})
  options[:methods] = [:url] if not options[:methods]
  options[:methods] = [options[:methods]] if options[:methods].kind_of? Symbol
  options[:methods] << :url if options[:methods]
  raise 'options[:methods] should be an array' unless options[:methods].kind_of? Array
  super options
end

#urlObject



12
13
14
# File 'app/models/active_record_json_url_extension.rb', line 12

def url
  UrlHelper.new(self).url
end