Sha256: 59ab8d68900fef83f251b0f6af09a366651858febb1495f8d05edfc790f8f044
Contents?: true
Size: 442 Bytes
Versions: 2
Compression:
Stored size: 442 Bytes
Contents
module BcmsBitly module PageExtender def self.included(model) model.after_create :bcms_bitly_create_short_link model.has_one :short_link, class_name: 'BcmsBitly::ShortLink' def bcms_bitly_create_short_link domain = Rails.configuration.cms.site_domain sl = build_short_link sl.url = sl.shorten("http://#{domain}#{path}") sl.name = name sl.save end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
bcms_bitly-0.0.4 | lib/bcms_bitly/page_extender.rb |
bcms_bitly-0.0.2 | lib/bcms_bitly/page_extender.rb |