Sha256: 7ab5fad97310c6c9338e70deb99f844dc4c1e666ac9413f087af73191e1e510e

Contents?: true

Size: 720 Bytes

Versions: 23

Compression:

Stored size: 720 Bytes

Contents

module RedactorRails
  module Orm
    module Base
      module AssetBase
        module InstanceMethods
          def has_dimensions?
            respond_to?(:width) && respond_to?(:height)
          end

          def image?
            RedactorRails::IMAGE_TYPES.include?(data_content_type)
          end

          def image
            url
          end

          def thumb
            url(:thumb)
          end

          def as_json_methods
            [:image, :thumb]
          end

          def as_json(options = nil)
            options = {
              :methods => as_json_methods,
              :root => false
            }

            super options
          end
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 5 rubygems

Version Path
redactor-rails-fixes-0.5.0.1 lib/redactor-rails/orm/base.rb
rdrails5-0.5.1 lib/redactor-rails/orm/base.rb
redactor-rails4-0.5.0 lib/redactor-rails/orm/base.rb
redactor-rails-0.5.0 lib/redactor-rails/orm/base.rb
redactor-rails-0.4.5 lib/redactor-rails/orm/base.rb
redactor-rails-0.4.4 lib/redactor-rails/orm/base.rb
th_simple_content_management-0.2.7 lib/redactor-rails/orm/base.rb
th_simple_content_management-0.2.6 lib/redactor-rails/orm/base.rb
th_simple_content_management-0.2.5 lib/redactor-rails/orm/base.rb
th_simple_content_management-0.2.4 lib/redactor-rails/orm/base.rb
th_simple_content_management-0.2.3 lib/redactor-rails/orm/base.rb
redactor-rails-0.4.3 lib/redactor-rails/orm/base.rb
redactor-rails-0.4.2 lib/redactor-rails/orm/base.rb
redactor-rails-0.4.1 lib/redactor-rails/orm/base.rb
redactor-rails-0.3.7 lib/redactor-rails/orm/base.rb
redactor-rails-0.3.6 lib/redactor-rails/orm/base.rb
redactor-rails-0.4 lib/redactor-rails/orm/base.rb
th_simple_content_management-0.2.2 lib/redactor-rails/orm/base.rb
redactor-rails-0.3.5 lib/redactor-rails/orm/base.rb
redactor-rails-0.3.3 lib/redactor-rails/orm/base.rb