theSteveMitchell / after_party

Automated post-deploy tasks for Ruby/Rails. Your deployment is the party. This is the after party
MIT License
241 stars 50 forks source link

attr_accessible :version isn't being set for rails 4 #28

Closed chrisdrappier closed 5 years ago

chrisdrappier commented 8 years ago

https://github.com/theSteveMitchell/after_party/blob/3c911207101277f9166bb3d497b24a853b2f8c54/lib/after_party/models/active_record/task_record.rb

should if ::Rails::VERSION::MAJOR.to_i == 3 be if ::Rails::VERSION::MAJOR.to_i >= 3 instead? i can put in a PR for this if you think it's a reasonable change.

michaelirey commented 6 years ago

@chrisdrappier Sorry for the delayed response. I'll look into adding this in.

theSteveMitchell commented 5 years ago

@chrisdrappier thanks for the note! Attr_accessible was deprecated in Rails 4 and beyond, so actually the statement could read version <= 3. But since this gem never supported Rails versions below 3, I don't think it's worthwhile to change that.

Actually, the real answer is that version should have been an attr_accessor. That was just lazy on my part, so I plan to remove that in an upcoming release.

Interestingly, this attribute was part of ActiveRecord::Base in Rails 2, then moved to ActiveModel::MassAssignmentSecurity::ClassMethods in Rails 3, before being removed completely in Rails 4 and going forward.