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_leaf-1.1.0.rc15 app/models/local_patron.rb
enju_leaf-1.1.0.rc14 app/models/local_patron.rb
enju_leaf-1.1.0.rc13 app/models/local_patron.rb
enju_leaf-1.1.0.rc12 app/models/local_patron.rb
enju_leaf-1.1.0.rc11 app/models/local_patron.rb
enju_leaf-1.1.0.rc10 app/models/local_patron.rb
enju_leaf-1.1.0.rc9 app/models/local_patron.rb
enju_leaf-1.1.0.rc8 app/models/local_patron.rb
enju_leaf-1.1.0.rc7 app/models/local_patron.rb
enju_leaf-1.1.0.rc6 app/models/local_patron.rb
enju_leaf-1.1.0.rc5 app/models/local_patron.rb
enju_leaf-1.1.0.rc4 app/models/local_patron.rb
enju_flower-0.1.0.pre11 spec/dummy/app/models/local_patron.rb
enju_flower-0.1.0.pre10 spec/dummy/app/models/local_patron.rb
enju_biblio-0.1.0.pre42 spec/dummy/app/models/local_patron.rb
enju_leaf-1.1.0.rc3 app/models/local_patron.rb
enju_leaf-1.1.0.rc2 app/models/local_patron.rb
enju_biblio-0.1.0.pre41 spec/dummy/app/models/local_patron.rb
enju_flower-0.1.0.pre9 spec/dummy/app/models/local_patron.rb
enju_biblio-0.1.0.pre40 spec/dummy/app/models/local_patron.rb