yahiaelgamal/smartsoft-14

Creating New Model for addresses

Closed this issue · 2 comments

@sedramina
This is a new model for addresses that needs to be added to the class diagram and has the following fields:
field :name, type: String
field :first , type: String
field :firstname, type: String
field :lastname, type: String
field :country, type: String
field :city, type: String
field :postal, type: Integer
field :street, type: String
field :coordinates, :type => Array , :default => [31.235726308822677,30.044366207449162]
, has the following validations:
validates :name , :presence => true
validates :firstname , :presence => true
validates :lastname , :presence => true
validates :country , :presence => true
validates :city , :presence => true
validates :postal , :presence => true , :numericality => true , length: { is: 5 }
validates :street , :presence => true
, the following relations:
belongs_to :member , class_name: "Member" , inverse_of: :addresses
has_and_belongs_to_many :order , class_name: "Order" , inverse_of: :address
and the following methods:
def index
def show
def update
def edit
def new
def create
def destroy
def position
Note: 1) The street attribute used by the gecode gem to get the coordinates
2) This model was created by @mahmoudawadeen and then I add some modifications.

whats the meaning of the "first" field ?@mahmoudawadeen @karim-elbawab

Its a field I used to pass the id to the drop down list in choosing the address for an order @sedramina