Sha256: 2dc3e4b4cd827c04f66c3c5b38135b5886c7ee70253a3f00ec286ec9ec2c6618

Contents?: true

Size: 832 Bytes

Versions: 5

Compression:

Stored size: 832 Bytes

Contents

require 'rubygems'
require 'bundler/setup'


require 'active_record'
require 'phony_rails'

ActiveRecord::Base.establish_connection(
  :adapter  => "sqlite3",
  :database => ":memory:"
)

ActiveRecord::Schema.define do
create_table :homes do |table|
  table.column :phone_attribute, :string
  table.column :phone_number, :string
end
end

class Home < ActiveRecord::Base
  attr_accessor :phone_method, :phone1_method, :country_code
  phony_normalized_method :phone_attribute # adds normalized_phone_attribute method
  phony_normalized_method :phone_method # adds normalized_phone_method method
  phony_normalized_method :phone1_method, :default_country_code => 'DE' # adds normalized_phone_method method
  phony_normalize :phone_number # normalized on validation
end

RSpec.configure do |config|
  # some (optional) config here  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
phony_rails-0.1.5 spec/spec_helper.rb
phony_rails-0.1.4 spec/spec_helper.rb
phony_rails-0.1.3 spec/spec_helper.rb
phony_rails-0.1.2 spec/spec_helper.rb
phony_rails-0.1.1 spec/spec_helper.rb