Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module ActiveRecordRepository
- class ItemRepository
- def model_class
- ActiveRecordRepository::Item
- end
- def new_item(item_details = {})
- model_class.new(item_details)
- end
- def save(item)
- item.save
- end
- def all
- model_class.all
- end
- def find_by(name)
- model_class.find_by(name)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement