discourse/discourse — pull request #691 by ZogStriP (2013-04-10 13:04:09+00:00)
Title: FIX: setting min_topic_title_length is ignored

Meta: [Setting min_topic_title_length is ignored](http://meta.discourse.org/t/setting-min-topic-title-length-is-ignored/5737)

This fixes the issue reported by @sanderdatema regarding the `min_topic_title_length` setting.

The following code was actually being *parsed* only **once**, during the first execution, and the `in` parameter was set to the default value of the `topic_title_length` and **never** to be changed.

```ruby
validates :title, length: { in: SiteSetting.topic_title_length }
```

To fix it, we need to wrap it in a lambda:

```ruby
validate :title, -> { SiteSetting.topic_title_length.include? :length }
```

I've also fixed the same issue for the `stripped_length` of the `raw` content of a `post` and updated the `SiteSetting` to prevent them from overriding the default value of several settings in test.