Sha256: 4693192754784144545981e5b5bea77fdc381882816c2bd1117b3a50ca8d8e86

Contents?: true

Size: 248 Bytes

Versions: 4

Compression:

Stored size: 248 Bytes

Contents

class State < ActiveRecord::Base

  attr_accessible :name, :abbreviation

  validates :name, uniqueness: {scope: :abbreviation}

  scope :for_abbreviation, ->(abbrev){where(abbreviation: abbrev)}

  scope :for_name, ->(name){where(name: name)}

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
looky-lu-0.0.4 lib/app/models/State.rb
looky-lu-0.0.3 lib/app/models/State.rb
looky-lu-0.0.2 lib/app/models/State.rb
looky-lu-0.0.1 lib/app/models/State.rb