Module: LimitedEdit

Extended by:
ActiveSupport::Concern
Included in:
Post, Topic
Defined in:
app/models/concerns/limited_edit.rb

Instance Method Summary collapse

Instance Method Details

#edit_time_limit_expired?(user) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
9
10
# File 'app/models/concerns/limited_edit.rb', line 6

def edit_time_limit_expired?(user)
  return true if user.trust_level < SiteSetting.min_trust_to_edit_post
  time_limit = user_time_limit(user)
  created_at && (time_limit > 0) && (created_at < time_limit.minutes.ago)
end