lib/passworks/inflector.rb in passworks-2.0.6 vs lib/passworks/inflector.rb in passworks-2.0.7
- old
+ new
@@ -7,10 +7,12 @@
case collection_name
when 'assets'
'asset'
when 'certificates'
'certificate'
+ when 'templates'
+ 'template'
when 'boarding_passes'
'boarding_pass'
when 'coupons'
'coupon'
when 'store_cards'
@@ -29,13 +31,16 @@
# If collection_uuid == nil return [Passworks::CampaignResource] else return [Passworks::PassResource]
def resource_class
return Passworks::AssetResource if collection_name == 'assets'
# CertificateResource has no overrides, but follow along the normal flow.
return Passworks::CertificateResource if collection_name == 'certificates'
+ return Passworks::TemplateResource if collection_name == 'templates'
if collection_uuid
Passworks::PassResource
- else
+ elsif ['boarding_passes', 'coupons', 'store_cards', 'event_tickets', 'generics'].include?(collection_name)
Passworks::CampaignResource
+ else
+ raise 'Invalid Resource Class'
end
end
end
end
\ No newline at end of file