lib/passworks/inflector.rb in passworks-0.0.4 vs lib/passworks/inflector.rb in passworks-2.0.0

- old
+ new

@@ -5,10 +5,12 @@ # @return [String] singular version of the current collection name def single_name case collection_name when 'assets' 'asset' + when 'certificates' + 'certificate' when 'boarding_passes' 'boarding_pass' when 'coupons' 'coupon' when 'store_cards' @@ -24,10 +26,12 @@ # Return resource class based in collection_name and collection_uuid # If collection_name return [Passworks::AssetResource] # If collection_uuid == nil return [Passworks::CampaignResource] else return [Passworks::PassResource] def resource_class - return Passworks::AssetResource if collection_name == 'assets' + return Passworks::AssetResource if collection_name == 'assets' + # CertificateResource has no overrides, but follow along the normal flow. + return Passworks::CertificateResource if collection_name == 'certificates' if collection_uuid Passworks::PassResource else Passworks::CampaignResource end \ No newline at end of file