Hi Vitaliy,

I actually think initializer is the right place to put those kind of stuff. Or, 
maybe do you want to put it in `bin/setup` so you would run it the first time 
after you clone your application?

Alternatively, there are a few data migration gems that you could use, but I 
think that's still not what you are looking for either, right?

Thank you,
Prem

> On Nov 24, 2017, at 9:34 AM, Vitaliy Klachkov <blackst0ne...@gmail.com> wrote:
> 
> Hello!
> 
> Sorry if this proposal is a duplicate, I couldn't find anything related.
> 
> Quite often I have to run some actions on my application starts.
> Those actions should be executed just once like database migrations.
> 
> Once an action is executed, it should never be invoked again. 
> 
> Right now I do what I need in migrations which is not right as migrations go 
> for database related logic. 
> My actions are not related to database (e.g. clean some files, do something 
> with cache, send something to an external service, etc). 
> 
> I can use those actions in initialiazers with `if` conditions, but that looks 
> quite weird. 
> 
> My proposal is simple. 
> Please consider adding a DB migrations-like mechanism for actions that should 
> be run once on start. 
> 
> Thank you.
> 
> Best wishes, 
> Vitaliy.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Core" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to rubyonrails-core+unsubscr...@googlegroups.com 
> <mailto:rubyonrails-core+unsubscr...@googlegroups.com>.
> To post to this group, send email to rubyonrails-core@googlegroups.com 
> <mailto:rubyonrails-core@googlegroups.com>.
> Visit this group at https://groups.google.com/group/rubyonrails-core 
> <https://groups.google.com/group/rubyonrails-core>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to