app/models/rostra/question.rb in rostra-0.1.18 vs app/models/rostra/question.rb in rostra-0.1.19
- old
+ new
@@ -8,13 +8,14 @@
conditions: { 'rostra_question_followings.send_email_notifications' => true }
acts_as_taggable
acts_as_voteable
is_impressionable counter_cache: { unique: true }
+ extend FriendlyId
+ friendly_id :title, use: :slugged
- validates :title, :presence => true, :uniqueness => true, :length => { :minimum => 15 }
- validates :user, :presence => true
- validates :tag_list, :presence => true
+ validates :title, presence: true, uniqueness: true, length: { :minimum => 15 }
+ validates_presence_of :user, :slug, :tag_list
before_save :create_question_following
attr_accessor :follow_by_email
# Set number of questions per page for will paginate