Comment

Comment by jbverschoor

Is there a reason why it was not created with multiple commands / methods in mind? :

  class UserService
  service :signup do |config|
    config.required do end
    config.optional do end
    config.execute
        # signup stuff here
    end
  end
   
  service :delete_account do |config|
    config.required do end
    config.optional do end
    config.execute
        # signup stuff here
    end
  end
  end

This would also make it possible to do service description and even expose a json or xml api using just this.

But I guess the controllers are created for this. DHH says controllers are responsible for mailing and stuff, which is more correct than in the models with callbacks.

parent jbverschoor 13 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton