| // A little lesson on naming conventions in Laravel Eloquent: // Table 1: product_variants - variations of a certain product // Table 2: variant_usage - pivot table between product_variants and usage // Table 3: usage - the various product variant uses // Usage - returns all usages for the ProductVariant model public function usage() | |
| { | |
| return $this->belongsToMany('App\Usage', 'variant_usage', 'variant_id', 'usage_id'); | |
| // Note: the 2nd/3rd/4th parameters wouldn't be necessary... | |
| // ...if the 'variant_usage' table were named 'product_variant_usage' | |
| // ...or if 'product_variant' were simply named 'variant' | |
| // ...(i.e. - product_variants --> product_variant_usage --> usage) | |
| // Also Note: the ID parameters are the connecting points in variant_usage | |
| // ...(i.e. - product_variants --> {variant_id --> usage_id} --> usage) | |
| } |
Working with code within the constraints of Salesforce's workflow can be a challenge. First , you have the restriction on changing anything in production. Second , you have the requirement for 75% or greater unit test coverage. Third , you have the fact that certain metadata cannot be pushed to production through a changeset (which means the only way to sync record IDs is by re-deploying the development environment from production). Fourth - and this is what I'd like to blog about today - you cannot delete classes from production through the Salesforce UI . The only way to delete a class from production is to download the class (and its associated metadata file) into the Eclipse IDE (which you have previously set up with the Apex add-on), change the "status" flag to "Deleted", then deploy the changed metadata file to production. And (here's the kicker)...sometimes it doesn't work because...reasons. So let's start with the workflow of a f...
Comments
Post a Comment