Sha256: db1c3d4d2aa0bb7196cba2c5fd9c5e09d0921b611950a62ce774ee6da0e3a548

Contents?: true

Size: 433 Bytes

Versions: 94

Compression:

Stored size: 433 Bytes

Contents

module Feedback
  class Config < ApplicationRecord
    has_many :feedbacks, inverse_of: :config, dependent: :nullify

    def self.find_or_create_config(config)
      last_config = last
      if last_config && last_config.attributes.slice('title', 'paths') == config
        return last_config
      end

      new_config = new(title: config['title'], paths: config['paths'])
      new_config.save
      new_config
    end
  end
end

Version data entries

94 entries across 94 versions & 1 rubygems

Version Path
station-0.5.16 lib/nexmo_developer/app/models/feedback/config.rb
station-0.5.15 lib/nexmo_developer/app/models/feedback/config.rb
station-0.5.14 lib/nexmo_developer/app/models/feedback/config.rb
station-0.5.13 lib/nexmo_developer/app/models/feedback/config.rb
station-0.5.12 lib/nexmo_developer/app/models/feedback/config.rb
station-0.5.11 lib/nexmo_developer/app/models/feedback/config.rb
station-0.5.10 lib/nexmo_developer/app/models/feedback/config.rb
station-0.5.9 lib/nexmo_developer/app/models/feedback/config.rb
station-0.5.8 lib/nexmo_developer/app/models/feedback/config.rb
station-0.5.7 lib/nexmo_developer/app/models/feedback/config.rb
station-0.5.6 lib/nexmo_developer/app/models/feedback/config.rb
station-0.5.5 lib/nexmo_developer/app/models/feedback/config.rb
station-0.5.4 lib/nexmo_developer/app/models/feedback/config.rb
station-0.5.3 lib/nexmo_developer/app/models/feedback/config.rb
station-0.5.2 lib/nexmo_developer/app/models/feedback/config.rb
station-0.5.1 lib/nexmo_developer/app/models/feedback/config.rb
station-0.5.0 lib/nexmo_developer/app/models/feedback/config.rb
station-0.4.9 lib/nexmo_developer/app/models/feedback/config.rb
station-0.4.8 lib/nexmo_developer/app/models/feedback/config.rb
station-0.4.7 lib/nexmo_developer/app/models/feedback/config.rb