seixasfelipe / cleaners Goto Github PK
View Code? Open in Web Editor NEWCleaners - Management Application
License: MIT License
Cleaners - Management Application
License: MIT License
How do you guys create today feature specs?
We need an User model.
A Task is a small part of a service that will be ordered when you get your car to Cleaners.
Examples of tasks:
So a task can have usually a name and price (how much will you have to pay if you choose each task).
For reference see: public/layout/servicos-tarefas-todos.html
Some views have hardcoded labels on it, add them to yml files
A vehicle can be a car, truck, old car, SUV, etc that have to be cleaned.
Differently of most business, here at our company, a vehicle is the most important object, because where we will put some effort to clean it.
So, a vehicle must have a License Plate (this is very important to us to distinguish between many vehicles), usually we take note about the brand, color and model.
A Customer is someone who wants our service.
It is important to us store some relevant information of each Customer, like, name, email, birth's date, first date that a person became our customer, address, phone numbers.
For reference see: public/layout/clientes-todos.html
We cannot rely on specific country on our tests, we should isolate it, specially when we talk about labels.
It's still confusing for me the division on this app when we talk about the devise login gem. It has a lot of "labels", or translations, we could reuse (DRY) but also I don't know how we could leverage that.
So guys,
Think about the licensing. We just need to put on a file called LICENSES.TXT. However this is tricky, we need to chose between a lot of licenses, the best one that fits this app =)
Let me know your thoughts about it
Will addresses view have an index, edit and new html.erb's?
also, do you think it makes sense to separate those views pertained to addresses (country, states, cities, etc organized into one folder?
Addresses
\__ Countries
\__ _form.html.erb, edit, index, new
\__ States
\__ _form, edit, index, new
\__ Cities
\__ ...
Routing this in application would be
http://server/countries/edit maps to addresses/countries/edit.html.erb
Must be installed and configured this gem for all the app. What do you think about it? And its views? May be installed too?
A Service is a job that will be done by our cleaning team, it is actually what we sell to people, that's our core business.
When someone wants his car cleaned, he comes to our cleaner area with his car, choose what kind of tasks we must do ( basic wash and use wax for instance) and pay for the service.
Thus, the service is composed by:
For reference see: public/layout/servicos-todos.html
Rails support it out of the box if I'm not mistaken. So we could start populating the ymls right away what do you guys think?
This model could be an unplugged model and all the other models that belongs to the address
model will create a foreign key to this model. Fo example, I'm a customer
and I have an address
.
So, it's necessary update the customer
table with a foreign key to address
table
class AddAddressToCustomer < ActiveRecord::Migration
def change
add_column :customers, :address_id, :integer
end
end
And in the customer
model define the relationship between these models. A little ruby code to demonstrate my idea:
# app/models/customer.rb
class Customer < ActiveRecord::Base
# ...
belongs_to :address
accepts_nested_attributes_for :address, allow_destroy: true
end
And here is an example of the address
model:
# app/models/address.rb
class Address < ActiveRecord::Base
attr_accessible :country, :country_id, :state, :state_id, :street,
:district, :city, :zip_code
belongs_to :country # if this is a model
belongs_to :state # if this is a model
end
None attribute will be mandatory on address
model. If the customer
inform his address we will fill all the fields and persist them in database.
What do you think?
A Vehicle does not exist without a Customer, because a Vehicle belongs to someone eheh.
In addition, a Customer can have many different vehicles.
The relationship would be better to do inside the Customer details (edit page).
For reference see: public/layout/clientes-detalhes.html
If you run rake:seed several times, it will create several times the number of records in the database, is it normal @fabianoalmeida ?
Which version do you guys have?
I currently have postgres (PostgreSQL) 9.2.3
As Fabiano Almeida said:
If the actions use defaults behavior we don't need define these methods. The
responders
gem will do that for us.
and
We don't need to use
respond_to
. I installedresponders
gem to solve this for us. Take a look here. So, all actions for all controllers will respond tohtml
. If we want to use other way, just put a comma after the last one and add the new way, for example:
respond_to :html, :json
So, what are we waiting for???
Things got a little messy - we forgot some model names, etc.
I suggest we create a small database model as a guideline for reference...
Should we have only one person taking care of merging other person's code (pull requests)?
Are we going to have milestones?
Yes, I'm building without test as I'm learning again the basics. But no excuses, DO TEST seixasfelipe ! =)
Surround code with tests, not only empties *_spec.rb
files!
@seixasfelipe asked me a question on how we suppose to run rspec. Usually I do:
$ rspec -c
However, we suppose to run rspec features (yeah only features, translation is a feature that needs to be catched) for each country available in the application.
You can see the start of this work on de3f080, however I don't know how to proceed or if this is ever tested in ROR
I thought about something like:"
RSpec.configure do |config|
config.i18n.available_locations do |locale|
and so on over rspec_helper.rb
How could we setup running feature specs for all available countries we have?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.