Method: HasMedia::ClassMethods#has_one_medium

Defined in:
lib/has_media.rb

#has_one_medium(context, options = {}) ⇒ Object

has_one_medium Define a class method to link to a medium

Parameters:

  • context, (String)

    the context (or accessor) to link medium

  • options, (Hash)

    can be one of : encode, only



142
143
144
145
146
# File 'lib/has_media.rb', line 142

def has_one_medium(context, options = {})
  set_relations(context, :has_one)
  set_general_methods
  create_one_accessors(context, options)
end