Sha256: d8e9bdc517957c542d3e8baa471dd7c93a46847c4fc99424e908597c12926b61

Contents?: true

Size: 520 Bytes

Versions: 65

Compression:

Stored size: 520 Bytes

Contents

class LocalPatron
  include ActiveModel::Validations
  include ActiveModel::Conversion
  extend ActiveModel::Naming

  attr_accessor :username, :full_name, :address, :email

  def initialize(attributes = {})
    if attributes[:username]
      user = User.where(:username => attributes[:username]).first
      if user
        send('email=', user.email)
      end
    else
      attributes.each do |name, value|
        send("#{name}=", value)
      end
    end
  end

  def persisted?
    false
  end

  def id
  end
end

Version data entries

65 entries across 65 versions & 3 rubygems

Version Path
enju_biblio-0.1.0.pre28 spec/dummy/app/models/local_patron.rb
enju_biblio-0.1.0.pre27 spec/dummy/app/models/local_patron.rb
enju_biblio-0.1.0.pre26 spec/dummy/app/models/local_patron.rb
enju_flower-0.1.0.pre2 spec/dummy/app/models/local_patron.rb
enju_biblio-0.1.0.pre25 spec/dummy/app/models/local_patron.rb
enju_biblio-0.1.0.pre24 spec/dummy/app/models/local_patron.rb
enju_biblio-0.1.0.pre23 spec/dummy/app/models/local_patron.rb
enju_biblio-0.1.0.pre22 spec/dummy/app/models/local_patron.rb
enju_biblio-0.1.0.pre21 spec/dummy/app/models/local_patron.rb
enju_biblio-0.1.0.pre20 spec/dummy/app/models/local_patron.rb
enju_flower-0.1.0.pre spec/dummy/app/models/local_patron.rb
enju_biblio-0.1.0.pre19 spec/dummy/app/models/local_patron.rb
enju_biblio-0.1.0.pre18 spec/dummy/app/models/local_patron.rb
enju_biblio-0.1.0.pre17 spec/dummy/app/models/local_patron.rb
enju_biblio-0.1.0.pre16 spec/dummy/app/models/local_patron.rb
enju_biblio-0.1.0.pre15 spec/dummy/app/models/local_patron.rb
enju_biblio-0.1.0.pre14 spec/dummy/app/models/local_patron.rb
enju_biblio-0.1.0.pre13 spec/dummy/app/models/local_patron.rb
enju_biblio-0.1.0.pre12 spec/dummy/app/models/local_patron.rb
enju_biblio-0.1.0.pre11 spec/dummy/app/models/local_patron.rb