Module: BlacklightUserGeneratedContent::ActiveRecordDuckType::ActiveRecordClassMethods

Defined in:
lib/blacklight_user_generated_content/active_record_duck_type.rb

Overview

ActiveRecord mock methods

Instance Method Summary collapse

Instance Method Details

#base_classObject



22
23
24
# File 'lib/blacklight_user_generated_content/active_record_duck_type.rb', line 22

def base_class
  self
end

#compute_type(type_name) ⇒ Object



30
31
32
# File 'lib/blacklight_user_generated_content/active_record_duck_type.rb', line 30

def compute_type(type_name)
  ActiveSupport::Dependencies.constantize(type_name)
end

#pluralize_table_namesObject



42
43
44
# File 'lib/blacklight_user_generated_content/active_record_duck_type.rb', line 42

def pluralize_table_names
  false
end

#primary_keyObject



26
27
28
# File 'lib/blacklight_user_generated_content/active_record_duck_type.rb', line 26

def primary_key
  :id
end

#quote_value(*args) ⇒ Object



34
35
36
# File 'lib/blacklight_user_generated_content/active_record_duck_type.rb', line 34

def quote_value *args
  ActiveRecord::Base.quote_value *args
end

#table_exists?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/blacklight_user_generated_content/active_record_duck_type.rb', line 38

def table_exists?
   false
end