class Hyrax::ActiveEncode::InstallGenerator

Public Instance Methods

enhance_file_set() click to toggle source
# File lib/generators/hyrax/active_encode/install_generator.rb, line 9
def enhance_file_set
  # This module include has to come before Hyrax::FileSetBehavior since it finalizes properties
  insert_into_file 'app/models/file_set.rb', before: 'include ::Hyrax::FileSetBehavior' do
    "include Hyrax::ActiveEncode::FileSetBehavior\n  "
  end
  # The indexer has to be set after Hyrax::FileSetBehavior in order to have effect
  insert_into_file 'app/models/file_set.rb', after: 'include ::Hyrax::FileSetBehavior' do
    "\n  self.indexer = Hyrax::ActiveEncode::ActiveEncodeIndexer"
  end
end
install_active_encode() click to toggle source
# File lib/generators/hyrax/active_encode/install_generator.rb, line 20
def install_active_encode
  rake 'active_encode:install:migrations'
  rake 'db:migrate'
end