Class: PettanrPettanCommonsV01Licenses::Attribute

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/pettanr_pettan_commons_v01_licenses/attribute.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.remember_params(params, operators) ⇒ Object



28
29
30
31
32
33
# File 'app/models/pettanr_pettan_commons_v01_licenses/attribute.rb', line 28

def self.remember_params params, operators
  op = OriginalPicture.show params[:original_picture_id], operators
  oplg = OriginalPictureLicenseGroup.new(params[:original_picture_license_group])
  lg = LicenseGroup.show oplg.license_group_id, operators
  [op, oplg, lg]
end

Instance Method Details

#resource_picture_attributes(op, ls) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/models/pettanr_pettan_commons_v01_licenses/attribute.rb', line 12

def resource_picture_attributes op, ls
  {
    :original_picture_id => op.id, 
    :license_id => ls.id, 
    :artist_name => self.artist_name, 
    :license_group_classname => ls.license_group_classname, 
    :license_group_settings => ls.license_group_settings,
    :credit_picture_settings => ls.credit_picture_settings, 
    :license_settings => {
      :system_picture_id => ls.system_picture_id,
      :caption => self.caption, 
      :sources => self.sources
    }.to_json
  }
end

#supply_default(operators) ⇒ Object



8
9
10
# File 'app/models/pettanr_pettan_commons_v01_licenses/attribute.rb', line 8

def supply_default operators
  self.artist_name = operators.artist.name
end