I am new in Ruby and Rails.
I’d like to use Declarative transaction management like Java’s @Transactional annotation in Rails.
Does anyone know how to use “Declarative transaction management” in Rails?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
there is nothing like annotations in ruby, but you could build yourself something similar using meta programming. Remember, private, protected, and public are also simply methods and not keywords. You could build yourself something similar
maybe this gem https://github.com/fredwu/ruby_decorators helps you with that.
Or even better https://github.com/michaelfairley/method_decorators, there is also a sample which implements a Decorator for Transactions.