joshuabowers / opium

An Object Parse.com Mapping technology for defining models.
MIT License
1 stars 0 forks source link

Opium::Push: support targeted pushes #54

Open joshuabowers opened 7 years ago

joshuabowers commented 7 years ago

Currently, Push requires a channel option be specified upon creating the push, and that the push target the set of channels exclusively. It would be nice to allow targeting of installations via the where option:

p = Opium::Push.new where: Installation.where( device_type: :ios ) 

This would necessitate the creation of an Installation class for semantic reasons. Such a class is separately desirable for managing installations via the API. However, this might be slightly over thinking the requirements for performing a push query. Perhaps something like the following:

p = Opium::Push.new where: { device_type: :ios }

Both could be supported, with one being implemented on top of the other. The Installation syntax would have the benefit of being able to use Opium::Model::Criteria to validate / name convert.