Sha256: 9d380a3bba9b7026691e72a51349e14c8517a8a23322f58b47f5011a52dec65f

Contents?: true

Size: 630 Bytes

Versions: 4

Compression:

Stored size: 630 Bytes

Contents

module SeoUnpakt
  class LivingInInfo < ActiveRecord::Base
  	@@info_types = ["city", "state"]

    validates :state, presence: true
  	validates :city, presence: true, :if => :info_type_is_city?

    validates :info_type, inclusion: { in: @@info_types} 
    # attr_accessible :title, :body
    def info_type_is_city?
    	self.info_type == "city"
    end

    def self.default_body city=""
      "At Unpakt, we know movers, and we can connect you with great moving companies in #{city}. Take a moment to browse a few of our featured #{city} movers so that you can begin comparing reviews and quotes instantly!"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
seo_unpakt-1.0.5 app/models/seo_unpakt/living_in_info.rb
seo_unpakt-1.0.4 app/models/seo_unpakt/living_in_info.rb
seo_unpakt-1.0.3 app/models/seo_unpakt/living_in_info.rb
seo_unpakt-1.0.2 app/models/seo_unpakt/living_in_info.rb