Initial commit
This commit is contained in:
29
app/models/sample_appearance_release.rb
Normal file
29
app/models/sample_appearance_release.rb
Normal file
@@ -0,0 +1,29 @@
|
||||
class SampleAppearanceRelease < AppearanceRelease
|
||||
after_initialize do |record|
|
||||
# Set default values for any required attributes which are missing
|
||||
record.attributes = default_attrs.update(record.attributes.compact)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def default_attrs
|
||||
{
|
||||
person_address: "Street Address, City, State Zipcode",
|
||||
person_first_name: "Some",
|
||||
person_last_name: "Person",
|
||||
person_phone: "555-555-5555",
|
||||
person_photo: sample_person_photo,
|
||||
signature: sample_signature,
|
||||
}
|
||||
end
|
||||
|
||||
def sample_person_photo
|
||||
path = Rails.root.join("spec", "fixtures", "files", "person_photo.png")
|
||||
Rack::Test::UploadedFile.new(path, "image/png")
|
||||
end
|
||||
|
||||
def sample_signature
|
||||
path = Rails.root.join("spec", "fixtures", "files", "signature.png")
|
||||
Rack::Test::UploadedFile.new(path, "image/png")
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user