Sha256: 819cbe16a2a31e717451e8b359f1353ddfb7a81c02337f04fefa415645041fb8

Contents?: true

Size: 335 Bytes

Versions: 3

Compression:

Stored size: 335 Bytes

Contents

class Post < ActiveRecord::Base

  has_many :translations
  accepts_nested_attributes_for :translations, :allow_destroy => true

    Image = Struct.new(:url) do
      def url(type = nil)
        type = "original" if type.blank?
        Rails.root.join("sample/#{type.to_s}.png")
      end
    end

  def image
    Image.new
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
weeler-2.1.0 spec/dummy/app/models/post.rb
weeler-2.0.1 spec/dummy/app/models/post.rb
weeler-2.0.0 spec/dummy/app/models/post.rb