0
我想排除一個類的一大組屬性的時間戳更新。許可證時間戳更新集同樣很大,因此它們之間的選擇並不重要。如何有效地檢查一組屬性中的任何一個屬性是否已經改變before_save?
我怎樣才能縮小像下面這樣?:
def determine_timestamp_update
if self.attr_1_changed?|| self.attr_2_changed? || ... || ... || ...
self.class.record_timestamps = false
else
self.class.record_timestamps = true
end
end