These warnings appear in the logs in the development environment, and, with Rails 7, the application will crash. When running the tests, they would appear in the standard error ouput if we set `config.cache_classes = false` in the test environment but, since that isn't the case, they don't. To reproduce these warnings (or the lack of them), start a Rails console in development and check the log/development.log file.
23 lines
517 B
Ruby
23 lines
517 B
Ruby
Rails.application.reloader.to_prepare do
|
|
ActsAsVotable::Vote.class_eval do
|
|
include Graphqlable
|
|
end
|
|
end
|
|
|
|
ActsAsVotable::Vote.class_eval do
|
|
belongs_to :signature
|
|
belongs_to :budget_investment, foreign_key: "votable_id", class_name: "Budget::Investment"
|
|
|
|
scope :public_for_api, -> do
|
|
where(votable: [Debate.public_for_api, Proposal.public_for_api, Comment.public_for_api])
|
|
end
|
|
|
|
def self.count_for(votable_type)
|
|
where(votable_type: votable_type).count
|
|
end
|
|
|
|
def value
|
|
vote_flag
|
|
end
|
|
end
|