pushtype / push_type

PushType is a modern, open source content management system for Ruby on Rails.
http://www.pushtype.org
Other
290 stars 32 forks source link

Add optional to node user associations #48

Closed aaronrussell closed 6 years ago

aaronrussell commented 6 years ago

Default behaviour in Rails >5 makesbelongs_to required by default. Change in User model:

belongs_to :creator, class_name: 'PushType::User', optional: true
belongs_to :updater, class_name: 'PushType::User', optional: true
ryenski commented 6 years ago

I started to work on this, but I wasn't able to make a failing test. Reason being, with Rails < 5.2 the records are valid even without the optional: true parameter. Any ideas?

aaronrussell commented 6 years ago

This change was made in this commit:

https://github.com/pushtype/push_type/commit/64ba0c9d1329ee2428ff01e6f4891897436242c1

I also couldn't create a failing test prior... ¯_(ツ)_/¯ ... but not gonna lose sleep over it. Will close this.