Class: Redirect
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Redirect
- Defined in:
- app/models/redirect.rb
Instance Method Summary collapse
Instance Method Details
#normalize_urls ⇒ Object
9 10 11 |
# File 'app/models/redirect.rb', line 9 def normalize_urls [ :old_url, :new_url ].map{|attribute| write_attribute attribute, normalize_url(send attribute) } end |
#validate_urls ⇒ Object
13 14 15 |
# File 'app/models/redirect.rb', line 13 def validate_urls errors.add(:base, I18n.t('duplicate_url_error')) if old_url == new_url end |