impress/app/models/parent_swf_asset_relationship.rb
Matchu d97c32b5da Upgrade to Rails 5.2.8.1
Some important little upgrades but mostly straightforward!

Note that there's still a known issue where item searches crash, I was hoping that this was a bug in Rails 4.2 that would be fixed on upgading to 5, but nope, oh well!

Also uhh I just got a bit silly and didn't actually mean to go all the way to 5.2 in one go, I had meant to start at 5.0… but tbh the 5.1 and 5.2 changes seem small, and this seems to be working, so. Yeah ok let's roll!
2023-10-23 19:05:05 -07:00

19 lines
358 B
Ruby

class ParentSwfAssetRelationship < ApplicationRecord
self.table_name = 'parents_swf_assets'
belongs_to :parent, :polymorphic => true
belongs_to :swf_asset
def item=(replacement)
self.parent = replacement
end
def pet_state
PetState.find(parent_id)
end
def pet_state=(replacement)
self.parent = replacement
end
end